Accents

Discussion in 'ASP General' started by Paulo, Jul 24, 2009.

  1. Paulo

    Paulo Guest

    What is the command to replace the accents for the browser recognizing them?

    Because on "Response.Write(rs("FieldName"))" comes from the DB a word with
    accent like: "Vitória"

    But the browser shows a strange character on this word " ó "

    But if I go to the source code page it shows ok...
     
    Paulo, Jul 24, 2009
    #1
    1. Advertising

  2. Paulo wrote:
    > What is the command to replace the accents for the browser recognizing them?
    >
    > Because on "Response.Write(rs("FieldName"))" comes from the DB a word with
    > accent like: "Vitória"
    >
    > But the browser shows a strange character on this word " ó "


    You need to tell the browser the encoding used for your response. You
    can do that by setting
    Response.Charset = "ISO-8859-1"
    where ISO-8859-1 is just an example, replace that with the encoding you use.

    --

    Martin Honnen --- MVP XML
    http://msmvps.com/blogs/martin_honnen/
     
    Martin Honnen, Jul 24, 2009
    #2
    1. Advertising

  3. Paulo wrote on Fri, 24 Jul 2009 11:56:38 -0300:

    > What is the command to replace the accents for the browser recognizing
    > them?


    > Because on "Response.Write(rs("FieldName"))" comes from the DB a word
    > with accent like: "Vitória"


    > But the browser shows a strange character on this word " ó "


    > But if I go to the source code page it shows ok...



    As well as Martin's suggestion, you can do this:

    Response.Write Server.HTMLEncode(rs("FieldName"))

    which will replace all the extended characters with their HTML encoded
    versions.

    --
    Dan
     
    Daniel Crichton, Jul 27, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon Maz
    Replies:
    4
    Views:
    1,072
    Jon Maz
    Jun 15, 2004
  2. Chris Leffer

    Accents and HtmlEncode

    Chris Leffer, Jan 11, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    755
    Chris Leffer
    Jan 11, 2005
  3. Tiggy
    Replies:
    0
    Views:
    566
    Tiggy
    May 4, 2004
  4. Ghislain Benrais

    Xml, Accents and php domxml_open_file

    Ghislain Benrais, Oct 11, 2003, in forum: XML
    Replies:
    2
    Views:
    917
    Ghislain Benrais
    Oct 13, 2003
  5. Luc The Perverse

    Function for removing Accents?

    Luc The Perverse, May 16, 2006, in forum: Java
    Replies:
    39
    Views:
    12,599
    Dale King
    May 25, 2006
Loading...

Share This Page