MCPcopy Create free account
hub / github.com/antvis/F2Native / utf16_encode

Function utf16_encode

core/android/JNIUtil.cpp:426–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426static void utf16_encode(char32_t pt, std::u16string & out) {
427 if (pt < 0x10000) {
428 out += static_cast<char16_t>(pt);
429 } else if (pt < 0x110000) {
430 out += { static_cast<char16_t>(((pt - 0x10000) >> 10) + 0xD800),
431 static_cast<char16_t>((pt & 0x3FF) + 0xDC00) };
432 } else {
433 out += 0xFFFD;
434 }
435}
436
437// 替代StringToJavaString函数,解决jni里string乱码的问题
438jstring jniStringFromUTF8(JNIEnv * env, const std::string & str) {

Callers 1

jniStringFromUTF8Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected