Lines Matching refs:code_point
1413 // code_point parameter is of type UInt32 because wchar_t may not be
1417 // If the code_point is not a valid Unicode code point
1420 char* CodePointToUtf8(UInt32 code_point, char* str) {
1421 if (code_point <= kMaxCodePoint1) {
1423 str[0] = static_cast<char>(code_point); // 0xxxxxxx
1424 } else if (code_point <= kMaxCodePoint2) {
1426 str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1427 str[0] = static_cast<char>(0xC0 | code_point); // 110xxxxx
1428 } else if (code_point <= kMaxCodePoint3) {
1430 str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1431 str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1432 str[0] = static_cast<char>(0xE0 | code_point); // 1110xxxx
1433 } else if (code_point <= kMaxCodePoint4) {
1435 str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1436 str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1437 str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1438 str[0] = static_cast<char>(0xF0 | code_point); // 11110xxx
1446 str, String::Format("(Invalid Unicode 0x%X)", code_point).c_str(), 32);