Results 1 to 4 of 4

Thread: Money Signs

  1. #1
    Join Date
    Aug 2011
    Location
    Rep Of Ireland
    Posts
    126
    Thanks
    24
    Thanked 3 Times in 1 Post

    Default Money Signs

    When I input the sign $ into the code below it presents as a Dollar Sign as required when rendered in the Browser.

    HTML Code:
    <select name="amount" class="dropdown">
                    <option value="500">$500</option>
                    <option value="100">€100</option>
                    <option value="50">€50</option>
                    <option value="20">€20</option>
                    <option value="10" selected="selected">€10</option>				
    			</select>
    How can the € sign be inputed to render as a Euro Sign?
    See descriptive image attached.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    you need to use proper character encoding. You should use UTF-8 encoding in your documents if you need to use uncommon (from a U.S. perspective) characters.

    Beyond that, you need to make sure your server sends the correct character encoding declaration, and include your character encoding in your html <head>:
    HTML Code:
    <!doctype html>
    <html>
    <head>
       <meta charset="UTF-8">
       <!--the character encoding should be declared as early as possible-->
       <!--note that the header sent by the _server_ is more important
             (browsers may ignore your meta tag in favor of such http headers)-->
    alternatively, you can simply use htmlentities: &euro; (or ) renders as .

    but using utf-8 is a FAR superior solution, and solves this problem for just about any character you may use.

  3. #3
    Join Date
    Aug 2011
    Location
    Rep Of Ireland
    Posts
    126
    Thanks
    24
    Thanked 3 Times in 1 Post

    Default

    The &euro; worked. Thanks for the alternative.

    I already had the <meta charset="UTF-8"> in the head. Just running the script in Firefox from Notepad++ and render was presenting the ? in a dark diamond in lieu of the € sign!
    Last edited by Webiter; 11-01-2011 at 03:53 PM. Reason: spelling error

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by Webiter View Post
    The &euro; worked. Thanks for the alternative.
    Glad it worked.
    Quote Originally Posted by Webiter View Post
    I already had the <meta charset="UTF-8"> in the head. Just running the script in Firefox from Notepad++ and render was presenting the ? in a dark diamond in lieu of the € sign!
    two things to check:

    1) make sure you are really using utf-8. Setting the character encoding is _useless_ (counterproductive, even) if it's not set correctly.

    2) make sure your _server_ is setting the same character encoding. the meta tag is only a "fallback." The http header sent by the server is what really matters.

    (in this case, there is no http header (since you're viewing it locally, from notepad++), so I would tend to think that you're not actually using utf-8 in your document - either that, or Windows is overriding the document encoding with the system setting for some reason. you can check (and change) the character encoding from notepad++.)

Tags for this Thread

Bookmarks

Posting Permissions

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