-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[libc] utf8 to 32 CharacterConverter #143973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
9561ab5
54c64e0
a82f9ee
4087711
84913d8
20cd8e5
a188c4b
9535c5b
82bff49
b1e17ad
3ad6866
3323d0d
19fabd3
b46a878
077525a
80d3a83
4f59bc7
60db657
25ab213
72db39d
0a5f434
039429d
8b2e2a9
50d690b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,8 @@ TEST(LlvmLibcCharacterConverterUTF8To32Test, TwoBytes) { | |
| LIBC_NAMESPACE::internal::mbstate state; | ||
| state.bytes_processed = 0; | ||
| state.total_bytes = 0; | ||
| const char ch[2] = {static_cast<char>(0xC2), static_cast<char>(0x8E)}; // | ||
| const char ch[2] = {static_cast<char>(0xC2), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dumb question: Are these static casts required? I would have expected them to be implicit.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is unfortunately not :( it wouldn't build without the casting |
||
| static_cast<char>(0x8E)}; // car symbol | ||
|
|
||
| LIBC_NAMESPACE::internal::CharacterConverter char_conv(&state); | ||
| char_conv.push(static_cast<char8_t>(ch[0])); | ||
|
|
@@ -47,7 +48,7 @@ TEST(LlvmLibcCharacterConverterUTF8To32Test, ThreeBytes) { | |
| state.bytes_processed = 0; | ||
| state.total_bytes = 0; | ||
| const char ch[3] = {static_cast<char>(0xE2), static_cast<char>(0x88), | ||
| static_cast<char>(0x91)}; // ∑ | ||
| static_cast<char>(0x91)}; // ∑ sigma symbol | ||
|
|
||
| LIBC_NAMESPACE::internal::CharacterConverter char_conv(&state); | ||
| char_conv.push(static_cast<char8_t>(ch[0])); | ||
|
|
@@ -64,7 +65,8 @@ TEST(LlvmLibcCharacterConverterUTF8To32Test, FourBytes) { | |
| state.bytes_processed = 0; | ||
| state.total_bytes = 0; | ||
| const char ch[4] = {static_cast<char>(0xF0), static_cast<char>(0x9F), | ||
| static_cast<char>(0xA4), static_cast<char>(0xA1)}; // 🤡 | ||
| static_cast<char>(0xA4), | ||
| static_cast<char>(0xA1)}; // 🤡 clown emoji | ||
|
|
||
| LIBC_NAMESPACE::internal::CharacterConverter char_conv(&state); | ||
| char_conv.push(static_cast<char8_t>(ch[0])); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.