How can I enter French in alert('French language') function?

Discussion in 'JavaScript' started by pvphuc, Apr 3, 2007.

  1. #1
    I want to use French in alert() function but I do not know how to do that.

    This is my code :

    Response.Write("<script language=javascript type='text/javascript'>");
    Response.Write("alert('expiré');");
    Response.Write("</script>");

    It is displayed : expir

    This character "é" is not displayed. I tried some cases and I got the same result.

    Please help me about this.

    Thanks a lot!

    Best Regards,

    pcphuc
     
    pvphuc, Apr 3, 2007 IP
  2. Thibaut

    Thibaut Well-Known Member

    Messages:
    886
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Hello,

    try this:

    Response.Write("alert('expir&eactue;');");

    Regards
    Thibaut
     
    Thibaut, Apr 4, 2007 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    ^^ This won't work either. Try setting the charset to iso-8859-1 in your page <head>

    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
    HTML:
    And try it again like you had at the beginning.
     
    nico_swd, Apr 4, 2007 IP
  4. pvphuc

    pvphuc Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for your response!

    But its result is the same.

    I do not know what happen.

    Could you give me another suggestion?

    Best Regards,

    pcphuc.
     
    pvphuc, Apr 4, 2007 IP
  5. pvphuc

    pvphuc Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Now I use char hexadecimal unicode for that and it works well.

    for example :
    Response.Write("<script language=javascript type='text/javascript'>");
    Response.Write("alert('expir\xE9');");
    Response.Write("</script>");

    xE9 : 223 -> its code is é

    This is link table of Unicode for sepcial character :
    http://biega.com/special-char.html


    Best Regards,

    pcphuc.
     
    pvphuc, Apr 4, 2007 IP