Solved

Euro character in javascript??

Posted on 2004-08-12
5
5,492 Views
Last Modified: 2013-12-03
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
Comment
Question by:joedutch
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
suramsureshbabu earned 125 total points
ID: 11790434
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
 
LVL 7

Expert Comment

by:suramsureshbabu
ID: 11790437
0
 
LVL 5

Assisted Solution

by:vilia
vilia earned 125 total points
ID: 11812324
> 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now