VB script, driving me crazy; vb bug ?

A

albertlaszlo

I have a very simple vb code, that suppose to remove some binary
character codes from a string. The results are different if the code
is running from IIS-WinXp or IIS-WinServer. After hours of searching I
managed to isolate the code that is creating the problem, but i cannot
understand why. Here is the code :
Z1.asp
<%
function Hexof(s)
dim ix, so
for ix =1 to len(s): so = so & Hex(Asc(Mid(s,ix,1))) & ".": next
HexOf = so
end function

Function Test()
Dim ix, s1

s1=""
For ix = 127 To 191: s1 = s1 & chr(ix): next
response.write "127..191....." & Hexof(s1)

End Function

test
%>

The results I get in IE 6, are :
for IIS on Win XP (INCORRECT?)
127..191.....7F.0.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.
7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.
7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.

for IIS on Win 2000 server (as expected):
127..191.....7F.80.81.82.83.84.85.86.87.88.89.8A.8B.8C.8D.8E.8F.
90.91.92.93.94.95.96.97.98.99.9A.9B.9C.9D.9E.
9F.A0.A1.A2.A3.A4.A5.A6.A7.A8.A9.AA.AB.AC.AD.AE.AF.B0.B1.B2.B3.B4.B5.B6.B7.B8.B9.BA.BB.BC.BD.BE.BF.

the funny part is that if run the same script from different locations
in the same IE session, I get inconsistent result
1. running XP\z1.asp returns the INcorrect result
2. running server\z1.asp returns the correct result
3. running XP\z1.asp returns the CORRECT result Surprised ?
I really am

Somebody might help me to get this thing out of my mind

Thanks
Laszlo
 
A

albertlaszlo

the difference would be the IIS version so you may want to post your question here:

Microsoft\Outlook Express\microsoft.public.inetserver.iis

They are the same version.
I will post it in the indicated spot

Thanks

Laszlo
 
B

Bob Barrows [MVP]

I have a very simple vb code, that suppose to remove some binary
character codes from a string. The results are different if the code
is running from IIS-WinXp or IIS-WinServer.

I'm at a loss. I have tested your code on multiple servers (from NT4 to
to XP to WS2003) running versions of IIS from 5-6, on IE6 and IE7, and I
get the same result no matter where or how I run the code.

I don't believe the result of this code should depend on regional
settings or encoding, but I can think of nothing else that would come
close to explaining your results. You should try testing the code as a
..vbs file, varying your regional settings to see if they have any effect
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top