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.