Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change Encoding from UTF-8 to Windows-1252

362 views
Skip to first unread message

Sergiu Damian

unread,
Apr 30, 2004, 6:02:20 AM4/30/04
to
Hello,

I have a WebService. All methods have a return value of type String.
I call all methods using HttpGet.
It seems that setting the follwing in web.config:

<globalization requestEncoding="windows-1252"
responseEncoding="windows-1252" />

works fine for all aspx pages, but not for asmx.

Whenever I call a WebMethod, the http response uses an encoding of utf-8,
and the xml returned seems to use utf-8 also.

example of the server response:

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Fri, 30 Apr 2004 09:59:21 GMT
X-Powered-By: ASP.NET
Connection: close
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 3333

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.xxx.com/services"> method response here</string>

How can I change the http response to use windows-1252, or, at least, the
<?xml....> to be encoded using "windows-1252" ?

Thank you,

Sergiu


DalePres

unread,
May 1, 2004, 10:41:35 PM5/1/04
to
You could try using a SOAP extension. If you're not sure where to start
with that, start by looking up the SoapExtension class in the framework
documentation.

Dale

"Sergiu Damian" <sergiu...@nivis.com> wrote in message
news:eM%23twppL...@TK2MSFTNGP11.phx.gbl...

Dino Chiesa [Microsoft]

unread,
May 3, 2004, 2:09:17 PM5/3/04
to
http://weblogs.asp.net/tmarman/archive/2004/02/02/66476.aspx

-Dino


"DalePres" <nos...@nomail.com> wrote in message
news:unZlB8%23LEH...@TK2MSFTNGP10.phx.gbl...

0 new messages