UmarAbbasKhan UmarAbbasKhan - 2 months ago 24
HTML Question

How to populate UTF-8 currency symbols in html 5 input element

I have the following html Input element:

<input size=6 type="text" id="prd_price" title="prd_price" name="prd_price" >

I have UTF-8 Currency Symbol "&#1084 ;&#1072 ;&#1085 ;" for "Azerbaijani manat
" which shows in html as "ман", saved in the database. I would like to populate this as the symbol inside HTML Input element and perhaps concatenate with the price of a product. But when I populate the Input Element dynamically with the UTF-8 Code, it remains in the code form and does not become the Currency Symbol it is suppose to become.

Anyone knows what am I missing here...


First of all I got the UTF-8 Code for Azerbaijani manat ман which is able to be run in javascript from "". In this case it came up to be \u043C\u0430\u043D. Then I ran it up with the following code to get it display inside the input element using javascript:

var x = "\u043C\u0430\u043D";
var r = /\\u([\d\w]{4})/gi;
x = x.replace(r, function (match, grp) {
    return String.fromCharCode(parseInt(grp, 16)); } );
x = unescape(x);