Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Character encoding problem: ISO-8859-1 and UTF-8
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kotze
Starting Member

2 Posts

Posted - 13 December 2004 :  12:06:36  Show Profile
hi guys,

I'm having the following problem: I have an ASP page that calls another JSP page, passing some strings as parameters. The strings have special characters, such as "ó" and "ê" (Portuguese characters). When passing those parameters, the JSP page receives them as UTF-8 characters, with 2 bytes each, but we would like them to be treated as ISO-8859-1 characters.

The ASP code that calls the JSP page is the following:

Response.ContentType="text/html"
Response.Charset="ISO-8859-1"
WebService2 = "http://sollipsis.homeip.net:8080/xxx/addRota.jsp"
WebService2 = WebService2 & "?phone=" & "@PHONE_NUMBER@"
WebService2 = WebService2 & "&status=" & "300"
WebService2 = WebService2 & "&id=" & "Rota Real"
WebService2 = WebService2 & "&data=Você"
Set Http = CreateObject("MSXML2.ServerXMLHttp")
Http.SetTimeouts 500000, 500000, 500000, 500000
Http.Open "GET", WebService2, False, "", ""
Http.setRequestHeader "Content-Type", "text/html; charset=iso-8859-1"
Http.send

We are receiving the string at the JSP page as characters 86, 111, 99, 195, 170, which is "Você" in ISO-8859-1, as displayed for us. 195 and 170 are the UTF-8 for "ê", which has code 234 in normal ISO-8859-1. We would like to receive the string as 86, 111, 99, 234, "Você".

What is wrong? We think the XML object being used to just to send the HTTP request is converting the characters to UTF-8...

thanks a lot for any help,
Carlos

Kotze
Starting Member

2 Posts

Posted - 14 December 2004 :  11:56:23  Show Profile
WebService2 = WebService2 & "&data=" & Server.URLEncode("Você")

solves the problem.

Carlos
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 14 December 2004 :  12:04:47  Show Profile  Send pdrg a Yahoo! Message
well self-solved and thanks for letting us all know!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07