/aosp12/system/libbase/ |
H A D | utf8.cpp | 45 utf8->clear(); in WideToUTF8() 71 utf8->resize(chars_required); in WideToUTF8() 80 utf8->clear(); in WideToUTF8() 89 return WideToUTF8(utf16, wcslen(utf16), utf8); in WideToUTF8() 95 return WideToUTF8(utf16.c_str(), utf16.length(), utf8); in WideToUTF8() 142 (void)UTF8ToWideWithFlags(utf8, size, utf16, 0); in UTF8ToWide() 147 bool UTF8ToWide(const char* utf8, std::wstring* utf16) { in UTF8ToWide() argument 149 return UTF8ToWide(utf8, strlen(utf8), utf16); in UTF8ToWide() 155 return UTF8ToWide(utf8.c_str(), utf8.length(), utf16); in UTF8ToWide() 163 if (!UTF8ToWide(utf8, utf16)) { in UTF8PathToWindowsLongPath() [all …]
|
H A D | utf8_test.cpp | 82 std::string utf8; in WideToUTF8() local 84 return utf8; in WideToUTF8() 123 std::ostringstream utf8; in TEST() local 143 const char* utf8; in TEST() member 208 const char* utf8; in TEST() member 264 const char* utf8; in TEST() member 348 return UTF8ToWide(utf8); in SysUTF8ToWide() 441 utf8 += "/mypathsegment"; in TEST() 451 namespace utf8 { namespace 457 std::string utf8 = td.path; in TEST() local [all …]
|
/aosp12/art/libdexfile/dex/ |
H A D | utf.cc | 31 size_t CountModifiedUtf8Chars(const char* utf8) { in CountModifiedUtf8Chars() argument 32 return CountModifiedUtf8Chars(utf8, strlen(utf8)); in CountModifiedUtf8Chars() 51 DCHECK_LE(byte_count, strlen(utf8)); in CountModifiedUtf8Chars() 53 const char* end = utf8 + byte_count; in CountModifiedUtf8Chars() 54 for (; utf8 < end; ++utf8) { in CountModifiedUtf8Chars() 55 int ic = *utf8; in CountModifiedUtf8Chars() 62 utf8++; in CountModifiedUtf8Chars() 67 utf8++; in CountModifiedUtf8Chars() 75 utf8++; in CountModifiedUtf8Chars() 206 if (*utf8 == '\0') { in CompareModifiedUtf8ToUtf16AsCodePointValues() [all …]
|
H A D | utf.h | 38 size_t CountModifiedUtf8Chars(const char* utf8); 39 size_t CountModifiedUtf8Chars(const char* utf8, size_t byte_count); 64 int CompareModifiedUtf8ToUtf16AsCodePointValues(const char* utf8, const uint16_t* utf16, 88 int32_t ComputeUtf16HashFromModifiedUtf8(const char* utf8, size_t utf16_length); 131 std::string PrintableString(const char* utf8);
|
H A D | utf_test.cc | 203 size_t CountModifiedUtf8Chars_reference(const char* utf8) { in CountModifiedUtf8Chars_reference() argument 206 while ((ic = *utf8++) != '\0') { in CountModifiedUtf8Chars_reference() 213 utf8++; in CountModifiedUtf8Chars_reference() 218 utf8++; in CountModifiedUtf8Chars_reference() 226 utf8++; in CountModifiedUtf8Chars_reference()
|
/aosp12/system/libbase/include/android-base/ |
H A D | utf8.h | 37 bool WideToUTF8(const wchar_t* utf16, const size_t size, std::string* utf8); 41 bool WideToUTF8(const wchar_t* utf16, std::string* utf8); 45 bool WideToUTF8(const std::wstring& utf16, std::string* utf8); 49 bool UTF8ToWide(const char* utf8, const size_t size, std::wstring* utf16); 53 bool UTF8ToWide(const char* utf8, std::wstring* utf16); 57 bool UTF8ToWide(const std::string& utf8, std::wstring* utf16); 70 bool UTF8PathToWindowsLongPath(const char* utf8, std::wstring* utf16); 88 namespace utf8 {
|
/aosp12/packages/apps/Bluetooth/jni/ |
H A D | com_android_bluetooth.h | 58 const uint8_t* utf8 = reinterpret_cast<const uint8_t*>(bytes++); in isValidUtf() local 60 switch (*utf8 >> 4) { in isValidUtf() 79 if ((*utf8 & 0x08) == 0) { in isValidUtf() 83 utf8 = reinterpret_cast<const uint8_t*>(bytes++); in isValidUtf() 84 if ((*utf8 & 0xc0) != 0x80) { in isValidUtf() 95 utf8 = reinterpret_cast<const uint8_t*>(bytes++); in isValidUtf() 96 if ((*utf8 & 0xc0) != 0x80) { in isValidUtf() 104 utf8 = reinterpret_cast<const uint8_t*>(bytes++); in isValidUtf() 105 if ((*utf8 & 0xc0) != 0x80) { in isValidUtf()
|
/aosp12/frameworks/base/tools/aapt2/cmd/ |
H A D | Compile_test.cpp | 66 ::android::base::utf8::unlink(path0_out.c_str()); in TEST_F() 68 ASSERT_EQ(::android::base::utf8::unlink(path0_out.c_str()), 0); in TEST_F() 70 ASSERT_EQ(::android::base::utf8::unlink(path0_out.c_str()), 0); in TEST_F() 74 ::android::base::utf8::unlink(path1_out.c_str()); in TEST_F() 76 ASSERT_EQ(::android::base::utf8::unlink(path1_out.c_str()), 0); in TEST_F() 82 ::android::base::utf8::unlink(path2_out.c_str()); in TEST_F() 91 ::android::base::utf8::unlink(path3_out.c_str()); in TEST_F() 99 ::android::base::utf8::unlink(path4_out.c_str()); in TEST_F() 107 ::android::base::utf8::unlink(path5_out.c_str()); in TEST_F() 122 ::android::base::utf8::unlink(kOutputFlata.c_str()); in TEST_F() [all …]
|
/aosp12/frameworks/base/libs/androidfw/ |
H A D | Util.cpp | 45 std::u16string Utf8ToUtf16(const StringPiece& utf8) { in Utf8ToUtf16() argument 47 utf8_to_utf16_length(reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length()); in Utf8ToUtf16() 54 utf8_to_utf16(reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length(), &*utf16.begin(), in Utf8ToUtf16() 65 std::string utf8; in Utf16ToUtf8() local 66 utf8.resize(utf8_length); in Utf16ToUtf8() 67 utf16_to_utf8(utf16.data(), utf16.length(), &*utf8.begin(), utf8_length + 1); in Utf16ToUtf8() 68 return utf8; in Utf16ToUtf8()
|
/aosp12/art/test/ti-agent/ |
H A D | ti_utf.h | 28 inline size_t CountModifiedUtf8Chars(const char* utf8, size_t byte_count) { in CountModifiedUtf8Chars() argument 29 DCHECK_LE(byte_count, strlen(utf8)); in CountModifiedUtf8Chars() 31 const char* end = utf8 + byte_count; in CountModifiedUtf8Chars() 32 for (; utf8 < end; ++utf8) { in CountModifiedUtf8Chars() 33 int ic = *utf8; in CountModifiedUtf8Chars() 40 utf8++; in CountModifiedUtf8Chars() 45 utf8++; in CountModifiedUtf8Chars() 53 utf8++; in CountModifiedUtf8Chars()
|
/aosp12/bionic/tests/ |
H A D | iconv_test.cpp | 60 char* in = const_cast<char*>(utf8); in TEST() 86 char* in = const_cast<char*>(utf8); in TEST() 115 char* in = const_cast<char*>(utf8); in TEST() 143 char* in = const_cast<char*>(utf8); in TEST() 169 char* in = const_cast<char*>(utf8); in TEST() 202 char* in = const_cast<char*>(utf8); in TEST() 223 const char* utf8 = "abc"; in TEST() local 229 char* in = const_cast<char*>(utf8); in TEST() 298 char* in = const_cast<char*>(utf8); in RoundTrip() 299 size_t in_bytes = strlen(utf8); in RoundTrip() [all …]
|
/aosp12/frameworks/base/tools/aapt2/util/ |
H A D | Util.cpp | 343 const size_t size = utf8.size(); in Utf8ToModifiedUtf8() 345 if (((uint8_t) utf8[i] >> 4) == 0xF) { in Utf8ToModifiedUtf8() 355 return utf8; in Utf8ToModifiedUtf8() 361 if (((uint8_t) utf8[i] >> 4) == 0xF) { in Utf8ToModifiedUtf8() 377 output.push_back(utf8[i]); in Utf8ToModifiedUtf8() 438 std::u16string Utf8ToUtf16(const StringPiece& utf8) { in Utf8ToUtf16() argument 440 reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length()); in Utf8ToUtf16() 447 utf8_to_utf16(reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length(), in Utf8ToUtf16() 458 std::string utf8; in Utf16ToUtf8() local 459 utf8.resize(utf8_length); in Utf16ToUtf8() [all …]
|
H A D | Files.cpp | 133 int result = ::android::base::utf8::mkdir(parent_path.c_str(), mode); in mkdirs() 139 return ::android::base::utf8::mkdir(path.c_str(), mode) == 0 || errno == EEXIST; in mkdirs() 213 unique_fd fd(TEMP_FAILURE_RETRY(::android::base::utf8::open(path.c_str(), flags))); in MmapPath()
|
/aosp12/system/core/libutils/ |
H A D | Unicode_test.cpp | 185 static char utf8[] = "\xc4\x00\x00\x00"; in TEST_F() local 186 ASSERT_DEATH(utf8_to_utf16_length((uint8_t *) utf8, strlen(utf8), in TEST_F()
|
/aosp12/frameworks/base/tools/aapt2/ |
H A D | StringPool.cpp | 367 static bool EncodeString(const std::string& str, const bool utf8, BigBuffer* out, in EncodeString() argument 369 if (utf8) { in EncodeString() 383 EncodeString(kStringTooLarge, utf8, out, diag); in EncodeString() 409 EncodeString(kStringTooLarge, utf8, out, diag); in EncodeString() 434 bool StringPool::Flatten(BigBuffer* out, const StringPool& pool, bool utf8, in Flatten() argument 443 if (utf8) { in Flatten() 457 no_error = EncodeString(entry->value, utf8, out, diag) && no_error; in Flatten() 462 no_error = EncodeString(entry->value, utf8, out, diag) && no_error; in Flatten()
|
/aosp12/system/tools/aidl/ |
H A D | aidl_to_cpp.cpp | 71 const bool utf8 = type.IsUtf8InCpp(); in RawParcelMethod() local 91 if (utf8) { in RawParcelMethod() 113 if (utf8) { in RawParcelMethod() 290 bool utf8 = type.IsUtf8InCpp(); in AddHeaders() local 310 headers->insert(utf8 ? "string" : "utils/String16.h"); in AddHeaders()
|
/aosp12/frameworks/wilhelm/tests/native-media/jni/ |
H A D | native-media-jni.c | 346 const char *utf8 = (*env)->GetStringUTFChars(env, filename, NULL); in Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer() local 347 assert(NULL != utf8); in Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer() 350 file = fopen(utf8, "rb"); in Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer() 352 ALOGE("Failed to open %s", utf8); in Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer() 394 (*env)->ReleaseStringUTFChars(env, filename, utf8); in Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer()
|
/aosp12/build/blueprint/proptools/ |
H A D | proptools.go | 30 r, size := utf8.DecodeRuneInString(fieldName) 48 r, size := utf8.DecodeRuneInString(propertyName)
|
/aosp12/packages/modules/adb/client/ |
H A D | fastdeploy.cpp | 145 std::string utf8; in get_string_from_utf16() local 146 utf8.resize(utf8_length); in get_string_from_utf16() 147 utf16_to_utf8(input, input_len, &*utf8.begin(), utf8_length + 1); in get_string_from_utf16() 148 return utf8; in get_string_from_utf16()
|
/aosp12/packages/modules/Wifi/service/java/com/android/server/wifi/hotspot2/anqp/ |
H A D | NAIRealmData.java | 76 boolean utf8 = (payload.get() & NAI_ENCODING_UTF8_MASK) != 0; in parse() 80 payload, utf8 ? StandardCharsets.UTF_8 : StandardCharsets.US_ASCII); in parse()
|
/aosp12/frameworks/base/libs/androidfw/include/androidfw/ |
H A D | StringPiece.h | 307 std::string utf8; variable 308 utf8.resize(static_cast<size_t>(utf8_len)); 309 utf16_to_utf8(str.data(), str.size(), &*utf8.begin(), utf8_len + 1); 310 return out << utf8;
|
/aosp12/frameworks/base/tools/powermodel/src/com/android/powermodel/ |
H A D | CsvParser.java | 59 final Charset utf8 = StandardCharsets.UTF_8; in parse() local 151 + new String(buf, 0, 20, utf8) + "..."); in parse()
|
/aosp12/frameworks/base/tools/aapt2/io/ |
H A D | FileStream.cpp | 43 fd_.reset(TEMP_FAILURE_RETRY(::android::base::utf8::open(path.c_str(), mode))); in FileInputStream() 114 owned_fd_.reset(TEMP_FAILURE_RETRY(::android::base::utf8::open(path.c_str(), mode, 0666))); in FileOutputStream()
|
/aosp12/frameworks/base/tools/aapt2/format/ |
H A D | Archive.cpp | 65 file_ = {::android::base::utf8::fopen(full_path.c_str(), "wb"), fclose}; in StartEntry() 136 file_ = {::android::base::utf8::fopen(path.to_string().c_str(), "w+b"), fclose}; in Open()
|
/aosp12/art/runtime/ |
H A D | reference_table.cc | 196 std::string utf8(s->ToModifiedUtf8()); in Dump() local 198 StringAppendF(&extras, " \"%s\"", utf8.c_str()); in Dump() 200 StringAppendF(&extras, " \"%.16s... (%d chars)", utf8.c_str(), s->GetLength()); in Dump()
|