Unicode conversion problem of some Chinese traditional characters

Discussion in 'ASP General' started by Elie Grouchko, May 22, 2004.

  1. 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
    Elie Grouchko, May 22, 2004
    #1
    1. Advertising

  2. Elie Grouchko

    Hans Guest

    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
    Hans, May 24, 2004
    #2
    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. Replies:
    1
    Views:
    508
    steve
    Dec 24, 2004
  2. Replies:
    1
    Views:
    348
    Nick Chan
    Sep 17, 2007
  3. Mohawk Mawk
    Replies:
    1
    Views:
    757
    Jukka K. Korpela
    Dec 15, 2008
  4. Grzegorz ¦liwiñski
    Replies:
    2
    Views:
    940
    Grzegorz ¦liwiñski
    Jan 19, 2011
  5. wsj
    Replies:
    0
    Views:
    150
Loading...

Share This Page