Would you like signs with those chars?
Would you like signs with those chars?
Posted Oct 24, 2022 21:19 UTC (Mon) by joib (subscriber, #8541)In reply to: Would you like signs with those chars? by cesarb
Parent article: Would you like signs with those chars?
When passing strings between C and Rust, the pointers can/must be cast to the correct type anyway. And when working in Rust-land, the Rust compiler handles strings per its own rules, and in C-land the C compiler handles chars per its rules.
(Adding to the potential confusion, Rust also has a 'char' type, which is a 4-byte value capable of storing a single UTF-32 codepoint, presumably under the covers it's considered unsigned. But indeed a string (str/String) is an u8 array containing UTF-8.)
