Solved

Euro character in javascript??

Posted on 2004-08-12
5
5,516 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

895 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

12 Experts available now in Live!

Get 1:1 Help Now