Discussion:
No Mapping for the Unicode character exists in the target multi-byte code page
(too old to reply)
Gaetan
2006-06-27 15:24:16 UTC
Permalink
I'm using VBScript to send requests to an IIS 6.0 server. If I fail to set the credentials, IIS will
send back a 401 status code. When I try to access the web page sent back from IIS using the
ResponseText property, I get the following VBScript error;

"No Mapping for the Unicode character exists in the target multi-byte code page"

Any idea on how I can access the data sent back to me from IIS? I used a network monitor to view the
data sent back from IIS and there does not seem to have any Unicode data. I can see the HTML text
coresponding to the 401 (unauthorized) error.

Thanks.
Stephen Sulzer
2006-06-28 18:47:37 UTC
Permalink
The WinHttpRequest.ResponseText property tries to convert the response data
into a Unicode string, and requires the Content-Type response header to
specify a character set attribute (charset). What is the value of the
Content-Type response header? It sounds like WinHttp does not recognize the
charset attribute.

If the Content-Type header does not include a charset attribute, then the
default is ISO-8859-1, which is similar to ASCII. Does the HTML page contain
a <META HTTP-EQUIV="Content-Type" /> element that declares a character set?
(WinHttp does not examine the HTML, however.)

If the server is not setting the Content-Type response header correctly,
then see if you can correct the problem on the server. If the server is
trying to specify the ISO-8859-1 character set, the charset attribute value
must be "ISO-8859-1" or "ISO8859_1" in order for WinHttp to recognize it.

If the problem cannot be corrected at the server, then you will probably not
be able to access the response data in this case. Although the
WinHttpRequest object also provides ResponseBody and ResponseStream
properties to access the response data, these cannot be used in VBScript.

- Stephen
Gaetan
2006-06-30 15:27:31 UTC
Permalink
Thanks Steven for the level of technical information.

Although i'm not yet certain, it may not be possible to have IIS to send the requested charset
information because the WinHTTP request does not even make it to my application.

Based on network traffic analysis, there are handshake packets exchanged between the client and the
server and all of them concerns credentials. Since I do not have any credential to provide to the
SetCredentials() method, IIS fails the WinHTTP Send() request and sends back the standard 401 error
along with the accompanying HTML web page.

I will research it but I doubt I can tweak IIS 6.0 to force it to send the "Content-Type" header
containing the charset because the IIS server is shared amongst many web applications.

Gaetan.

Continue reading on narkive:
Search results for 'No Mapping for the Unicode character exists in the target multi-byte code page' (Questions and Answers)
3
replies
Briefly describe the Microsoft's 2000 DNS management?
started 2006-08-17 22:05:37 UTC
computer networking
Loading...