Solved

Euro character in javascript??

Posted on 2004-08-12
5
5,627 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

717 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