Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2007, 11:55 PM
Authorized User
 
Join Date: Nov 2005
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
Default Encoding & xmlhttp object

showing garbage character in asp.net page, when special character ñ (Alt+164) is enter along with name.

this is extract of code that is causing problem:

Response.ContentType = "text/xml"
.............
.............

dim strFrom as string = "Johnñ"

Me.Response.AddHeader("from", strFrom)

.............
.............

" document.all." & Me.UniqueID.ToString & "_LblFrom.innerHTML='<B>From:</B> ' + " & "oXMLHTTP.getResponseHeader('from')" & vbNewLine

I know I have to convert it to different encoding or charset, I tried, it didnt work and not sure, please help.

Thanks.
 
Old April 22nd, 2007, 07:56 AM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could try using HtmlEncode.

 dim strFrom as string = Server.HtmlEncode("John�")


- Adam Kahtava [http://adam.kahtava.com]





Similar Threads
Thread Thread Starter Forum Replies Last Post
one user unable to create xmlhttp object mussitsch Classic ASP XML 2 August 31st, 2006 09:48 AM
Encoding problems with XMLHTTP boris Classic ASP XML 6 June 14th, 2006 08:24 AM
Reading XMLHTTP response object in VB Script afrika_people Classic ASP XML 0 March 5th, 2005 08:22 AM
XMLHTTP object lian_a Classic ASP XML 4 January 19th, 2005 10:18 PM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.