Unicode conversion problem of some Chinese traditional characters

E

Elie Grouchko

Hi All

Can anyone explain why the expression "AscW(ChrW(38321))" is equal to -27215
?

(38321 is the Unicode code for one of the Chinese traditional characters)

AscW is supposed to return a Long value, isn't it?

This also happens in VB6

Cheers

Elie Grouchko
 
H

Hans

From MSDN
Asc "Returns an integer representing the character code corresponding to the
first letter in a string"

So Asc returns an integer (and I guess ascW also returns an integer). To
represent larger values than 32768 negative values are used. At least VB
will give you the right (and same) character using ChrW(38321) or
ChrW(-27215).

It also says in MSDN about chr(charcode) function "on DBCS systems, the
actual range of charcode is -32768 to 65535"

Regards
/Hans Börjesson
 

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,019
Latest member
RoxannaSta

Latest Threads

Top