Mutibyte characters -> Unicode
Posted on 2001-07-24
I need to convert CString (VC++) to String (Java). This CString is encoded in multibyte character set format (MBSC), I can use the function MultiByteToWideChar() to convert MBSC to Unicode in VC++, but when I construct a new java.lang.String from this converted Unicode string through the JNI's function NewString(), the return String is not Unicode.
What's different between Unicode in VC++ and Java? How can I convert Unicode/MBCS correctly from VC++ to Java and vice versa?