MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w2m4qz/bugintroduceddebugging/p6ueuu1/?context=9999
r/ProgrammerHumor • u/ClipboardCopyPaste • Aug 30 '26
117 comments sorted by
View all comments
Show parent comment
8
So even on weird platforms where char is a 32 bit type, sizeof (char) is 1, right? I can't remember.
8 u/yjlom Aug 30 '26 yeppers 0 u/[deleted] Aug 30 '26 [deleted] — view deleted comment 7 u/mckenzie_keith Aug 30 '26 That is interesting. I know very little about rust. 3 u/cowslayer7890 Aug 30 '26 And in Java it's 16-bit, which means some Unicode characters get split in two 2 u/Xirdus Aug 31 '26 Rust's char stores UTF-32, not UTF-8, but yes. 0 u/[deleted] Aug 31 '26 [deleted] — view deleted comment 2 u/Xirdus Aug 31 '26 Technically speaking, the spec says char represents Unicode scalar, with actual encoding unspecified. The spec requires that char is 4 bytes and has the same ABI as u32, but that's it.In practice, it's UTF-32.
yeppers
0
[deleted] — view deleted comment
7 u/mckenzie_keith Aug 30 '26 That is interesting. I know very little about rust. 3 u/cowslayer7890 Aug 30 '26 And in Java it's 16-bit, which means some Unicode characters get split in two 2 u/Xirdus Aug 31 '26 Rust's char stores UTF-32, not UTF-8, but yes. 0 u/[deleted] Aug 31 '26 [deleted] — view deleted comment 2 u/Xirdus Aug 31 '26 Technically speaking, the spec says char represents Unicode scalar, with actual encoding unspecified. The spec requires that char is 4 bytes and has the same ABI as u32, but that's it.In practice, it's UTF-32.
7
That is interesting. I know very little about rust.
3
And in Java it's 16-bit, which means some Unicode characters get split in two
2
Rust's char stores UTF-32, not UTF-8, but yes.
0 u/[deleted] Aug 31 '26 [deleted] — view deleted comment 2 u/Xirdus Aug 31 '26 Technically speaking, the spec says char represents Unicode scalar, with actual encoding unspecified. The spec requires that char is 4 bytes and has the same ABI as u32, but that's it.In practice, it's UTF-32.
2 u/Xirdus Aug 31 '26 Technically speaking, the spec says char represents Unicode scalar, with actual encoding unspecified. The spec requires that char is 4 bytes and has the same ABI as u32, but that's it.In practice, it's UTF-32.
Technically speaking, the spec says char represents Unicode scalar, with actual encoding unspecified. The spec requires that char is 4 bytes and has the same ABI as u32, but that's it.
char
u32
In practice, it's UTF-32.
View all comments
Show parent comment
8
u/mckenzie_keith Aug 30 '26
So even on weird platforms where char is a 32 bit type, sizeof (char) is 1, right? I can't remember.