UTF8-Detection on the server?

S

Sven

Hi

I'm using a .NET client application that does requests to a VB6-server application hosted in an ASP page (the page simply created the object and calls a method passing the asp scripting context as a reference)

When using the ASP scripting context to get a query string variable containing an UTF8-encoded german character I get the wrong string - I guess because IIS is not knowing that the string is UTF8 instead of ASCII

The code to get the string is simply
Result = Server.Request.Item("file"

The same problem occures when querying a .NET site from a VB6 application - in this case the reqult is UTF8 and the VB6 application gets the UTF8 encoded €-sign without knowing that it needs to decode UTF8 to BSTR before searching for ASC(128)

So my questions:
1) is there a way to tell IIS inside a request that variables are UTF-8 in a way that IIS is providing the correctly decoded characters
2) is there a way for a VB6 client to detect UTF-8 encoding and successfully decode such a response to BSTR

Sven
 
M

Mark Schupp

Will all data submitted from the client be UTF-8 encoded?
If so, set the code page for asp to utf-8

Session.Codepage = 65001
--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


Sven said:
Hi,

I'm using a .NET client application that does requests to a VB6-server
application hosted in an ASP page (the page simply created the object and
calls a method passing the asp scripting context as a reference).
When using the ASP scripting context to get a query string variable
containing an UTF8-encoded german character I get the wrong string - I guess
because IIS is not knowing that the string is UTF8 instead of ASCII.
The code to get the string is simply
Result = Server.Request.Item("file")

The same problem occures when querying a .NET site from a VB6
application - in this case the reqult is UTF8 and the VB6 application gets
the UTF8 encoded ?-sign without knowing that it needs to decode UTF8 to BSTR
before searching for ASC(128).
So my questions:
1) is there a way to tell IIS inside a request that variables are UTF-8
in a way that IIS is providing the correctly decoded characters?
2) is there a way for a VB6 client to detect UTF-8 encoding and
successfully decode such a response to BSTR?
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top