Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Internationalization / April 2006

Tip: Looking for answers? Try searching our database.

How are UTF-8 data received at IIS?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Y - 20 Apr 2006 09:29 GMT
I have a <INPUT NAME='name'> on a FORM and page charset is set to UTF-8.

I entered and submitted these characters: . (Hope you can see them.)

On the ACTION page, I have the following code:

--------------------------------------------------------------------------------

<%
 Dim Name,X,i
 Name=request.Form("name")
 X="ASCII"
 for i=1 to Len(Name)
    X=X & ":" & AscW(mid(Name,i,1))
 next
%>
<%=Name%>
<%=X%>

--------------------------------------------------------------------------------

The first line shows the expected output:
The second line shows: ASCII:194:169:230:175:8250:230:179:189:228:184:339

First character: good 194:169 is the copyright symbol
Second character: no good.  What is the number 8250!
Third character: good 230:179:189 is the UTF-8 encoding for
Fourth character: no good.  What is 339!

I capture the downloaded page in binary and the first line bytes are actually (hexadecimal):
C2 A9 E6 AF 9B E6 B3 BD E4 B8 9C.

Why does AscW produce different results from the string at certain bytes?  This problem makes the data unuseable.  I get the same results on two different IIS machines.  What have I done wrong?

Any help will be greatly appreciated.

Thanks in advance
Tony Zhou - 22 Apr 2006 03:54 GMT
It seems that you are writing an ASP application.
Can you give us your OS language version and ASP source code?
It will help if we understand much more about the background and the detail.

Gook luck.

> I have a <INPUT NAME='name'> on a FORM and page charset is set to UTF-8.
>  
[quoted text clipped - 37 lines]
>  
> Thanks in advance.
Chris Y - 22 Apr 2006 04:59 GMT
Thanks.  I am on Windows Server 2003, but my development tool is
notepad.exe!  My source code is all that is in the message below.  And that
was the problem.  I am sure you can recreate it by copying and pasting the
code shown.

After more testing I found that again it was my negligence.  I did not force
the code page to 65001.  The moment I did that, AscW on the server behaves
correctly.

> It seems that you are writing an ASP application.
> Can you give us your OS language version and ASP source code?
[quoted text clipped - 34 lines]
>>  Any help will be greatly appreciated.
>>  Thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.