Unicode issue

E

Elie Grouchko

Hi All

I am submitting a form to IIS 5.0, the CODEPAGE is set to 1252 and the
charset is 'iso-8859-1'.

I noticed that if I type information in a language different from English I
get data from the Request.Form collection in the following Unicode format:
'stגד', i.e English characters unchanged and other characters
coded as Unicode characters. If I change the charset to the one that matches
the language in which I am typing (without changing the CODEPAGE) I get the
data in the local character codepage code.

Is it possible to get the data from the Request.Form collection in a
consistent format, independent of the CODEPAGE and charset settings, i.e.
always in the 'גד' format?

Many Thanks

Elie Grouchko
 
E

Egbert Nierop \(MVP for IIS\)

Elie Grouchko said:
Hi All

I am submitting a form to IIS 5.0, the CODEPAGE is set to 1252 and the
charset is 'iso-8859-1'.

I noticed that if I type information in a language different from English I
get data from the Request.Form collection in the following Unicode format:
'stגד', i.e English characters unchanged and other characters
coded as Unicode characters. If I change the charset to the one that matches
the language in which I am typing (without changing the CODEPAGE) I get the
data in the local character codepage code.

Is it possible to get the data from the Request.Form collection in a
consistent format, independent of the CODEPAGE and charset settings, i.e.
always in the 'גד' format?

I doubt it. The browser decides to encode characters if they are non-ascii.
At the moment, I don't know a browser, that sends unicode-2 as real 2 byte
characters, they all are encoded using the utf-8 format.

If you want an expectable format, use Response.Charset = "utf-8" and set the
asp-codepage to 65001

Regards,
 
E

Elie Grouchko

Hi Egbert, thanks for your help.

setting the character set to utf-8 is good but not good enough, it prevents
automatically alerting the users of missing language packs (at least that's
what the MS documentation say).

I was hoping that there was a way to configure ASP so that the returned data
would be in a consistent format independent from the page character-set,
well, if ASP doesn't do it I'll have to do it myself :)

Thanks again

Elie Grouchko
 
M

MSFT

Hi Elie,

Thank you for using MSDN Newsgroup. I am Luke and I am review this issue
currently. As I understand, you wan to way to configure ASP so that the
returned data would be in a consistent format independent from the page
character-set. In fact, when ASP sends a Web page to a browser, the browser
needs to know what character set to use to display the page properly, and
the language pack for that character set must be installed on the computer.
To specify the character set, use one of the following commands:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1252">
<% Response.Charset = "windows-1252" %>

This will force browser accept the page in "windows-1252".

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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
474,143
Messages
2,570,821
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top