How do I convert jstring to wchar_t *

前端 未结 10 880
闹比i
闹比i 2020-12-01 14:48

Let\'s say that on the C++ side my function takes a variable of type jstring named myString. I can convert it to an ANSI string as follows:

10条回答
  •  没有蜡笔的小新
    2020-12-01 15:38

    JNI has a GetStringChars() function as well. The return type is const jchar*, jchar is 16-bit on win32 so in a way that would be compatible with wchar_t. Not sure if it's real UTF-16 or something else...

提交回复
热议问题