Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Accents

Reply
Thread Tools

Accents

 
 
Paulo
Guest
Posts: n/a
 
      07-24-2009
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...


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      07-24-2009
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/
 
Reply With Quote
 
 
 
 
Daniel Crichton
Guest
Posts: n/a
 
      07-27-2009
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox Pb with accents in .htm and .html files on HD Ron Duval Firefox 0 01-13-2005 12:56 PM
Firefox Pb with accents in .htm and .html files on HD Ron Duval Firefox 0 01-13-2005 12:54 PM
Accents and HtmlEncode Chris Leffer ASP .Net 0 01-11-2005 06:43 PM
RegExp to strip accents while ignoring case Jon Maz ASP .Net 4 06-15-2004 08:58 AM
Tomcat 5.0 problem with accents in my html references (HREF) Tiggy Java 0 05-03-2004 11:28 PM



Advertisments