Home | History | Annotate | Download | only in src

Lines Matching refs:code_point

1431 // code_point parameter is of type UInt32 because wchar_t may not be
1433 // If the code_point is not a valid Unicode code point
1436 std::string CodePointToUtf8(UInt32 code_point) {
1437 if (code_point > kMaxCodePoint4) {
1438 return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")";
1442 if (code_point <= kMaxCodePoint1) {
1444 str[0] = static_cast<char>(code_point); // 0xxxxxxx
1445 } else if (code_point <= kMaxCodePoint2) {
1447 str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1448 str[0] = static_cast<char>(0xC0 | code_point); // 110xxxxx
1449 } else if (code_point <= kMaxCodePoint3) {
1451 str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1452 str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1453 str[0] = static_cast<char>(0xE0 | code_point); // 1110xxxx
1454 } else { // code_point <= kMaxCodePoint4
1456 str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1457 str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1458 str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1459 str[0] = static_cast<char>(0xF0 | code_point); // 11110xxx