VB script, driving me crazy; vb bug ?

Discussion in 'ASP General' started by albertlaszlo@gmail.com, Jan 30, 2008.

  1. Guest

    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
     
    , Jan 30, 2008
    #1
    1. Advertising

  2. Guest

    On Jan 30, 2:03 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
    dot com> wrote:
    > 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
     
    , Jan 30, 2008
    #2
    1. Advertising

  3. wrote:
    > 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
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 30, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William Gower

    ItemTemplate error driving me crazy

    William Gower, Apr 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    327
    William Gower
    Apr 23, 2004
  2. =?Utf-8?B?VGltOjouLg==?=

    Insert and Variables driving me crazy! Newbie...

    =?Utf-8?B?VGltOjouLg==?=, Dec 20, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    342
    =?Utf-8?B?VGltOjouLg==?=
    Dec 21, 2004
  3. Shapper
    Replies:
    0
    Views:
    338
    Shapper
    Apr 29, 2005
  4. Joe Blanchard via .NET 247
    Replies:
    1
    Views:
    773
    Eliyahu Goldin
    May 15, 2005
  5. Replies:
    3
    Views:
    437
    Kevin Spencer
    Jul 1, 2005
Loading...

Share This Page