Skip to content

Non ascii byte string literals broken #18697

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

Closed
mahkoh opened this issue Nov 6, 2014 · 4 comments
Closed

Non ascii byte string literals broken #18697

mahkoh opened this issue Nov 6, 2014 · 4 comments

Comments

@mahkoh
Copy link
Contributor

mahkoh commented Nov 6, 2014

test.rs:63:42: 63:43 error: byte constant must be ASCII. Use a \xHH escape for a non-ASCII byte: \xdf
test.rs:63     let mut br = BufReader::new(b"Hello, ß World");
                                                    ^

If this is by design then the design is wrong.

@mahkoh
Copy link
Contributor Author

mahkoh commented Nov 6, 2014

Some people seem to think that ASCII isn't an encoding and that byte literal actually means ASCII literal. Restricting byte literals to ASCII makes unnecessary assumptions about the use of byte literals and actively discriminates against people using languages other than English.

@mahkoh
Copy link
Contributor Author

mahkoh commented Nov 6, 2014

And, of course, the bytes! macro doesn't have this bug.

@mahkoh mahkoh closed this as completed Nov 6, 2014
@mahkoh mahkoh reopened this Nov 6, 2014
@mahkoh
Copy link
Contributor Author

mahkoh commented Nov 6, 2014

rust-lang/rfcs#69 (see the

It looks like this and the other shortcomings of byte string literals have been known for at least 4 months and yet neither have byte string literals been fixed nor has the bytes! macro been undeprecated.

@alexcrichton
Copy link
Member

An issue such as this belongs on the RFC repo instead of this repository (it is a language change).

lnicola pushed a commit to lnicola/rust that referenced this issue Dec 23, 2024
internal: Simplify ratoml testdir usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants