• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5782
  • Last Modified:

Euro character in javascript??

I been looin to find the euro symbol hex code for javascript all day. I dont mean the € html code.

I am using and have to use

charset=iso-8859-1

i find the pound character as '\xA3'
Does anybody knoe the euro character hex representation in javascript using this character set?
0
joedutch
Asked:
joedutch
  • 2
2 Solutions
 
suramsureshbabuCommented:
The Euro
The Euro Sign in HTML and Javascript
Standards require that the Euro is represented either as € or with its unicode number, as either € or € (tests : ?, ? and ? in your browser. In my MS IE4, only € is recognised).

In javascript strings, \u20AC can be used for the Euro character (test : ?
in your browser).

The Euro character is more reliably present in the simpler, more common text fonts than on older, rarer, or obscurer ones.
On Various Systems
In HTML, Dollar is represented by "$", but Pound by "£" or "£". I have not read of a corresponding small number for the Euro, but the deprecated "€" does work in my MSIE4, giving "?" - font permitting; I've since read of "€", the proper standard, giving "?". Numerically, 8364 = $20AC; see below;

HTML :- &#163; &pound; &#128; &#8364; &euro; <strike>C</strike>
You get :- £ £ ? ? ? C
Win98 Ed1
MSIE 4, local OK OK OK OK &euro; would serve

Also, "&euro;" should work - eventually. I hear that all work in Mozilla 1.1.

It may be that Hex can be used, so that Pound would use 00A3; but I cannot find a Hex form acceptable to MSIE 4.
0
 
suramsureshbabuCommented:
0
 
viliaCommented:
> euro symbol hex code

euroUnicode = 8364;
String.fromCharCode(euroUnicode)

please view an example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&lt;html&gt;
      <head>
      <script language="javascript">
      function showEuro() {
            euroUnicode = 8364;
            
            s = '';
            s += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n';
            s += '<html>\n';
            s += '      <head>\n';
            s += '            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\n';
            s += '      </head>\n';
            s += '      <body>\n';
            s += '            euroCode[' + euroUnicode +']=\"' + String.fromCharCode(euroUnicode) + '\"\n';
            s += '      </body>\n';
            s += '</html>\n'
            popUp = window.open("");
            popUp.document.write(s);
            popUp.document.close();      
      }
      
      showEuro();
      </script>
      </head>
      <body>
      </body>
&lt;/html&gt;
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now