Skip to content

Wrong uppercase for ß #79660

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
vbrandl opened this issue Dec 3, 2020 · 7 comments
Closed

Wrong uppercase for ß #79660

vbrandl opened this issue Dec 3, 2020 · 7 comments
Labels
A-Unicode Area: Unicode C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@vbrandl
Copy link
Contributor

vbrandl commented Dec 3, 2020

I tried this code:

println!("{}", 'ß'.to_uppercase());

I expected to see this happen:

I expected this to print (see Capital ).

Instead, this happened:

The code printed SS which is often use to represent ß in uppercase.

Since there is a dedicated character for the capital (which looks really similar to the lowercase ß in this font), I think to_uppercase should return the actual uppercase letter instead of SS.

Meta

rustc --version --verbose:

rustc 1.48.0 (7eac88abb 2020-11-16)
binary: rustc
commit-hash: 7eac88abb2e57e752f3302f02be5f3ce3d7adfb4
commit-date: 2020-11-16
host: x86_64-unknown-linux-gnu
release: 1.48.0
LLVM version: 11.0

rustc +nightly --version --verbose:

rustc 1.50.0-nightly (1c389ffef 2020-11-24)
binary: rustc
commit-hash: 1c389ffeff814726dec325f0f2b0c99107df2673
commit-date: 2020-11-24
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly
@vbrandl vbrandl added the C-bug Category: This is a bug. label Dec 3, 2020
@jonas-schievink jonas-schievink added A-Unicode Area: Unicode T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Dec 3, 2020
@lcnr
Copy link
Contributor

lcnr commented Dec 3, 2020

i.e. variants STRASSE vs. STRAẞE would be accepted as equally valid

(quickly scraped from https://en.wikipedia.org/wiki/%C3%9F#Capital_form)

I have never seen , even though I live in germany, and am not sure if changing this is preferable right now as the generally used capitalization is still SS from what I can tell.

@vbrandl
Copy link
Contributor Author

vbrandl commented Dec 3, 2020

While both are valid and the former one is used more often (actually I've never seen a capital in use and I'm from Germany, too), is the correct uppercase letter for ß...

@nikic
Copy link
Contributor

nikic commented Dec 3, 2020

Rust follows case mapping rules specified by Unicode, which specs that ß must map to SS under default SpecialCasing rules.

@bjorn3
Copy link
Member

bjorn3 commented Dec 3, 2020

This has been the case since #26039

@RalfJung
Copy link
Member

Rust follows case mapping rules specified by Unicode, which specs that ß must map to SS under default SpecialCasing rules.

So, given this -- is there even a bug here? One might consider this a Unicode bug, but even that is not clear, and Rust seems to be working as intended by matching what Unicode specifies.

@Alexendoo
Copy link
Member

Unicode doesn't consider it a bug - https://www.unicode.org/faq/casemap_charprop.html#11

@RalfJung
Copy link
Member

All right, closing as "not a bug" then. Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Unicode Area: Unicode C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants