[ACCEPTED]-Getting the unicode value of a char in VB-unicode

Accepted answer
Score: 25

What about AscW ?

0

Score: 3

The answer provided by RC. helped me a lot 5 but I had issues with the AscW() function sometimes 4 returning negative values.

In my case the 3 problem appeared when working with Chinese 2 characters.

I found a work around on the 1 web:

Function CharToUnicode(strChar As String)

    Dim lngUnicode As Long

    lngUnicode = AscW(strChar)

    If lngUnicode < 0 Then
        lngUnicode = 65536 + lngUnicode
    End If

    CharToUnicode = lngUnicode

End Function

More Related questions