Posted on 2001-06-08
I am having a problem converting a line of VBscript to Javscript. This is one line of code from a program which reads image dimensions from gif and jpeg files.
The original VBscript: (where strTemp always has length 2)
foo = clng(asc(right(strTemp, 1)) + (asc(left(strTemp, 1)) * 256))
return strTemp.charCodeAt(1) + (strTemp.charCodeAt(0) * 256);
foo = clng(ascW(right(strTemp, 1)) + (ascW(left(strTemp, 1)) * 256))
Since asc/ascW give different results, and charCodeAt()/ascW give the same incorrect results, I am assuming that this is a Unicode/Ansii issue, but that's as far as I can get.