iso8859-1 and utf-8

P

polo

Hello,

We have a .Net Web Service and we want to use iso-8859-1
instead of utf-8 in the response. How can we do that?

thanks for help

Polo
 
J

Jan Tielens

You can set the encoding in the web.config:
<globalization

requestEncoding="utf-8"

responseEncoding="utf-8"

/>
 
G

Guest

Thanks for help jan
but this as no effect
in my tcp trace
- http header is always ...utf-8
- xml prolog of the response is always ...utf-8

The client is a soap one!
Another idea?

Here is the service:
====================
Imports System.Web.Services
<System.Web.Services.WebService
(Namespace:="http://tempuri.org/pharmacies/Service1")> _
....
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod(), Protocols.SoapRpcMethod("PharmList")> _
Public Function PharmList() As String
Dim str As String
str = "âêîôûéàèùöäüë"
Return str
End Function
End Class

Here is the web.config:
=======================
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="Windows" />
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
<trace enabled="false" requestLimit="10"
pageOutput="false" traceMode="SortByTime"
localOnly="true" />
<globalization requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1" fileEncoding="iso-8859-1"/>
</system.web>
 
J

Jan Tielens

Mmmm, then I've got some bad news for you... I found this in a newsgroup:

Hi Paul,

Right now the responseencoding and requestencoding is not supported from
Web service.

Luke
Microsoft Online Support

So I think it won't be possible.

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
<[email protected]> schreef in bericht
Thanks for help jan
but this as no effect
in my tcp trace
- http header is always ...utf-8
- xml prolog of the response is always ...utf-8

The client is a soap one!
Another idea?

Here is the service:
====================
Imports System.Web.Services
<System.Web.Services.WebService
(Namespace:="http://tempuri.org/pharmacies/Service1")> _
....
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod(), Protocols.SoapRpcMethod("PharmList")> _
Public Function PharmList() As String
Dim str As String
str = "âêîôûéàèùöäüë"
Return str
End Function
End Class

Here is the web.config:
=======================
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="Windows" />
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
<trace enabled="false" requestLimit="10"
pageOutput="false" traceMode="SortByTime"
localOnly="true" />
<globalization requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1" fileEncoding="iso-8859-1"/>
</system.web>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top