Skip to content

Format! Padding strange utf-8 characters #17105

Closed
@decentninja

Description

@decentninja

This produces only spaces and does not terminate.

fn main() {
    println!("{:2}", "☃")
}

Output (lots of spaces)

☃                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
^C

I guess that the counting of the padding is incorrect when dealing double with unicode characters.

I run OSX 10.10 Beta x86_64

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