Created
November 9, 2015 11:07
-
-
Save 0xF6/7f7b705f5b4f18727542 to your computer and use it in GitHub Desktop.
CLR String to JNI String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jstring Aix::tojString(JNIEnv * pEnv, String^ str) | |
{ | |
array<byte>^ arr = Encoding::UTF8->GetBytes(str); | |
pin_ptr<Byte> pinnedBytes = &arr[0]; | |
jstring s = pEnv->NewStringUTF(reinterpret_cast<char*>(pinnedBytes)); | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment