Special Characters in textarea

Discussion in 'JavaScript' started by jijihuqw, Jun 15, 2011.

  1. #1
    Hello,

    I want to display special characters via Javascript in a Textarea (like French characters, é, è, à .....).

    If i type the directly in the javascript code, i get some weird simbols in my textarea. If i type them as HTML code (&eacute, then dat code is displayed instead of the character it represents.

    Any idea how to proceed?

    Many thanks!
     
    jijihuqw, Jun 15, 2011 IP
  2. Jan Novak

    Jan Novak Peon

    Messages:
    121
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Use UTF-8 encoding of your page in <meta> tag and also your file must be in UTF-8.
     
    Jan Novak, Jun 15, 2011 IP
  3. unknownpray

    unknownpray Active Member

    Messages:
    3,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    70
    #3
    The simplest solution is to just list the special characters on the page and let the user

    highlight, copy and paste them. However this requires a few precision mouse operations,

    especially with small characters.
     
    unknownpray, Jul 15, 2011 IP