Skip to content

c2rust translate unicode to utf8 but Rust doesn't support #762

Closed
@wain303009

Description

@wain303009
printf("\n  \e[32m\u2713 \e[90mok\e[0m\n\n");;

after translation of c2rust:

printf(
        b"\n  \x1B[32m\xE2\x9C\x93 \x1B[90mok\x1B[0m\n\n\0" as *const u8
            as *const libc::c_char,
    );

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions