How do I convert jstring to wchar_t *

前端 未结 10 864
闹比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:36

    If we are not interested in cross platform-ability, in windows you can use the MultiByteToWideChar function, or the helpful macros A2W (ref. example).

提交回复
热议问题