You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though both kind of string are supported by C, Rust only support the first unicode other than the second utf8, and compiler will report error as following: print! ("\n \x1B[32m\xE2\x9C\x93 \x1B[90mok\x1B[0m\n\n\0"); ^^^^ must be a character in the range [\x00-\x7f]
The text was updated successfully, but these errors were encountered:
doesn't compile, but that's because that's a ""&str, which must be UTF-8, not a b""&[u8] byte string, as it is in the c2rust-translated version.
c2rust translates C strings into byte strings as they may not be valid UTF-8, and Rust byte strings do not allow Unicode specifiers like \u{2713}, so we must translate it into its raw byte sequence. In the future, c"" C strings may be used, which I think may fix this issue, but that RFC (rust-lang/rfcs#3348, rust-lang/rust#105723) was just recently accepted. In the meantime, you'll need to re-encode the byte string into a UTF-8 string if you want to refactor it as such.
after translation of c2rust:
Though both kind of string are supported by C, Rust only support the first unicode other than the second utf8, and compiler will report error as following:
print! ("\n \x1B[32m\xE2\x9C\x93 \x1B[90mok\x1B[0m\n\n\0"); ^^^^ must be a character in the range [\x00-\x7f]
The text was updated successfully, but these errors were encountered: