Skip to content
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

fmt::Debug should not escape printable characters #24588

Closed
pnkfelix opened this issue Apr 19, 2015 · 3 comments
Closed

fmt::Debug should not escape printable characters #24588

pnkfelix opened this issue Apr 19, 2015 · 3 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@pnkfelix
Copy link
Member

(imported from improperly closed bug #22412)

pub fn main() {
    println!("{}", "äöüß");
    println!("{:?}", "äöüß");
}

prints:

äöüß
"\u{e4}\u{f6}\u{fc}\u{df}"

but probably should print:

äöüß
"äöüß"

(See discussion on #22412 for strategies for fixing this; team seemed pretty much on board for this change.)

@steveklabnik
Copy link
Member

Triage: no change. I do wonder about this kind of change with regards to stability though.

@estebank
Copy link
Contributor

I see where the sentiment comes from, but do consider that there're multiple ways to encode the same visual output. Debug using the \u{} format for those characters helps differentiate easily between ö and , for example.

@bluss
Copy link
Member

bluss commented Nov 15, 2016

This was fixed in #34485 and the examples in the original report have the desired output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

4 participants