Dear VB6,
I'm not sure if you were aware of this, but Unicode is a very big set of characters. The numeric representation, in fact, goes from x0000 to xFFFF. In decimal, that means it goes from 0 to 65,535. It rather needs to, as holding a spot for every character used in the world is a rather lot of characters.
Why, then, does the internal function for returning the character code of a unicode character (ascw) return an integer? Are you not aware that, in your own language, integers go from -32,768 to 32,767? And that you have a long data type that goes from -2,147,483,648 to 2,147,483,647?
Why do you cause me pain, VB6? Why do you hate me so very much?
The day I get to replace all our VB6 code with a more modern language will be a very, very happy day for me.
Update - the fix I had to do to make this work:
if (ascw(c) > 0) then
Response.write c & ascw(c) & "<br/>"
else
Response.write c & ((32769 - (ascw(c) * -1)) + 32767) & "<br/>"
end if