-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Date.toLocaleString contains invalid delimiter character #45753
Comments
What does |
|
What does it mean if it prints |
It means whoever compiled your binaries (not us) has either replaced ICU with a newer one or linked to your system ICU. |
I see. Let me check with my colleague to confirm this. Thanks for clarifying! |
I had a similar problem today. The Intl API is returning a string with the "No-Break Space" character (code 160) instead of the ASCII space character (code 32) Steps to reproduce: const expected = "R$ 100.000,00"
let formatted = (100_000).toLocaleString("pt-BR", { style: "currency", currency: "BRL" })
console.log(formatted === expected, expected.indexOf(" "), formatted.indexOf(" "));
formatted = new Intl.NumberFormat("pt-BR", { style: "currency", currency: "BRL" }).format(100_000);
console.log(formatted === expected, expected.indexOf(" "), formatted.indexOf(" "));
console.log(formatted.charCodeAt(2), expected.charCodeAt(2)) Output:
System info
|
Version
v18.12.1+1-b20221130T14204672
Platform
Linux osrvdv-rr-441 3.10.0-957.35.2.el7.x86_64 #1 SMP Wed Sep 18 05:51:28 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Run this script:
On Linux I see:
On Windows I see:
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
Delimiter of en-US should just be regular whitespace, and this should be consistent across operating systems.
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: