How do you output the Euro symbol intext/HTML/Javascript?

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default How do you output the Euro symbol intext/HTML/Javascript?

    Inserting the euro symbol causes problems. Some users report that they get
    a question mark, others that they get a little square. The problem remains,
    even
    when we switch from iso-8859-1 to the newer "euro" encoding, iso-8859-15, or
    when we use UTF-8. In each case we used a symbol written in an encoding's
    own character set, to avoid incompatibility.

    Only the Unicode value, \u20AC, seems to work without problems. Can you
    suggest other, or better, alternatives? Thanks in advance.




    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Euro symbol</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
    <meta http-equiv="content-style-type" content="text/css" >
    <meta http-equiv="content-script-type" content="text/javascript" >
    <script language="JavaScript">
    var curr = "";
    function calculate_rebate(f) {
    curr = f.currency.value;
    switch (curr){
    /* Alternative for Euro symbol = \u20AC. What other alternatives are
    there? */
    case "eur" : document.rebate_form.rebate.value=" ? 45,50";
    break;
    case "usd" : document.rebate_form.rebate.value=" $ 61.00";
    }
    }
    </script>
    </head>
    <body>
    <form name="rebate_form" action="#" method="post">
    Your currency: <select name="currency">
    <option value="eur" selected>Euro</option>
    <option value="usd">US Dollar</option>
    </select><br><br>
    <input type="Button" name="calculator" value="Calculate"
    onclick="calculate_rebate(this.form);"><br><br>
    Your rebate: <input type="text" name="rebate" size="10" maxlength="10">
    </form>
    </body>
    </html>

    BKBK Guest

  2. Similar Questions and Discussions

    1. Euro ? symbol for embeded fonts
      Hi all, I'm trying to use the Euro sign in an application, to render some data in Labels formatted with a CurrencyFormatter for which I specify '?'...
    2. HTML won't display ? symbol in drop-down menu list.
      What happened?, Can anyone help? I created drop-down selection list of amounts which a client might be willing to pay, however when I view the...
    3. output text in control location; calling control javascript from page javascript
      Hi; If you don't know, I'm just learning javascript and aspnet, but I have a pretty good grounding in windows programming. I'm trying to build a...
    4. checking for Euro currency symbol in regexp
      Hi, I want to check that a string entered via a from contains the only cdertain characters including the Euro currency symbol using a reg exp in...
    5. Writing Euro symbol with utf encoding
      Hello All I am writing a string from the database into a text file which contains "Euro" symbol . I have tried using iconv() and utf_encode and...
  3. #2

    Default Re: How do you output the Euro symbol intext/HTML/Javascript?

    Just Use Unicode (c). if your users are seeing garbaged text (they see ??) or
    have problems rendering text (boxes), that's *your* problem. you need to synch
    up your encoding end-to-end as well as make sure you're using a font that can
    render that encoding.

    this isn't rocket science.

    PaulH Guest

  4. #3

    Default Re: How do you output the Euro symbol intext/HTML/Javascript?

    >... Just Use Unicode (c). if your users are seeing garbaged text (they see ??)
    or
    >... have problems rendering text (boxes), that's *your* problem. you need to
    synch
    >... up your encoding end-to-end as well as make sure you're using a font that
    >... can render that encoding. this isn't rocket science.
    It is clear I already know I can use Unicode. I'm just asking if anyone has any
    other suggestions. No matter how much you know, you can always pick up
    tips from these forums. The only one I see in your message is "you need
    to synch up your encoding end-to-end as well ". I don't understand what you
    mean by that. Is it a kind of encoding?

    BKBK Guest

  5. #4

    Default Re: How do you output the Euro symbol intext/HTML/Javascript?

    bkbk, no its not clear that you understand unicode/encoding, otherwise if you
    understand unicode why are you asking this kind of question? why bother with
    anything else? do you really want to deal w/dozens and dozens of encodings? do
    you really want to handle multiple encodings per language? do you know what
    "mojibake" is? do you want to go back to living in a cave ;-)

    "synch up your encoding end-to-end" means exactly that. pretty much all these
    sort of problems boil down to encoding getting out of synch.

    PaulH Guest

  6. #5

    Default Re: How do you output the Euro symbol intext/HTML/Javascript?

    >... bkbk, no its not clear that you understand unicode/encoding, otherwise
    >...if you understand unicode why are you asking this kind of question?
    The science to launch a rocket into space is secondary school physics
    about centrifugal and centripetal forces, whose equations don't take
    one-quarter of an A4. The official literature on Unicode runs into several
    hundered pages. Even the final text on the Unicode of the Euro symbol
    has not yet been written. In any case Unicode is not as trivial or as final
    as you seem to suggest.
    >... do you really want to handle multiple encodings per language?
    There are occasions when you have no choice but to do just that.
    >... "synch up your encoding end-to-end" means exactly that.
    >... encoding getting out of synch
    My understanding of the "synch up", is that one synchs x up with y.
    What your x and y are is not clear. When you say "end-to-end", may I
    ask from which end to which end?
    >... do you know what "mojibake" is?
    A little. Oh, and enough to know you've written on the subject before.
    >... do you want to go back to living in a cave
    No need. I already do. In any case, I still miss a suggestion for
    an alternative.



    BKBK Guest

  7. #6

    Default Re: How do you output the Euro symbol intext/HTML/Javascript?

    bkbk, you seem to like to argue just to argue. i've fought all the unicode
    battles i'm going to fight around here. just be thankful you have it to use.

    i never said unicode is trivial though it's use in your case is. as far as it
    being final, it is as far as most of us are concerned. you won't find any
    changes being made that easily to the existing "set", even obscure/dead or
    obviously wrong things are very tough to get changed. why? because it took
    years & years to get to it's current state and folks have been using it for
    years & years. if not already, subscribe to the consortium's list & watch the
    debates fly. see how much of that goop actually
    impinges your life as a developer. when's the last time you had to deal with
    Woleai (Caroline Islands script)?

    you should be eliminating encodings to make your's & your users's lives
    simpler, not encouraging their growth. apps still not unicode enabled are
    dinosaurs & should be targeted for fixing ASAP.

    db-to-app-to-user and back again should all be the same encoding. that's good
    practice. there is no better alternative to using unicode.

    PaulH Guest

  8. #7

    Default Re: How do you output the Euro symbol intext/HTML/Javascript?

    >... bkbk, you seem to like to argue just to argue.
    I urge anyone who reads this to re-read the thread from the beginning,
    and show me just one place where I argue just to argue.
    >... as far as it being final, it is as far as most of us are concerned.
    Wrong. Clue: 2^16 is a constant! For most people, at least.
    >... db-to-app-to-user and back again should all be the same encoding.
    >... that's good practice. there is no better alternative to using unicode.
    This summarizes your response, so I'll react just to it. Some developers,
    work only with proprietary code. Someone else either owns the copyright,
    someone else developed it or someone else calls the shots. Much as you
    may want to unicode everything, you may only have limited access or
    limited control.

    In fact, that is the situation I'm facing. There is a comparable, even
    bigger problem, not unrelated to encoding. A customer's server that is
    running an ancient version of Coldfusion or a client running Windows 95
    and Internet Explorer 4. What do you do then? Barge in and change
    everything? I cannot identify with your mentality of eliminating
    encodings to make your's & your users's lives simpler, not encouraging
    their growth. It is not a realistic mentality. Sometimes you can only
    make do, do the best you can, with what you have before you.

    Doctors now universally recommend unsaturated oils as far healthier than
    saturated. You react here like a Doctor who goes about, grabbing people's
    burgers, and telling them they are dinosaurs & should be targeted for
    fixing ASAP.

    To other readers, please let me know if you have an alternative solution
    for the Euro symbol. Thanks in advance.




    BKBK Guest

  9. #8

    Default How do you output the Euro symbol intext/HTML/Javascript?

    use:
    '\u20AC' = € sign in javascript
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139