You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Date.toLocaleString contains invalid delimiter character #45753
#!/usr/bin/env node
constos=require('os')console.log('Operating System\n',os.platform(),os.release())console.log('Node JS Version\n',process.version)conststr=newDate().toLocaleString({locale: 'en-US'})console.log(`String value of', 'new Date().toLocaleString({ locale: 'en-US' })\n`,`"${str}"`)console.log('Char value at position 18\n',`"${str.charAt(18)}"`)console.log('Char code at position 18\n',str.charCodeAt(18))
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 does node -p process.versions (note the s at the end) print? This is the behaviour you would see with ICU 72.1 (see the same report for Node.js 19: #45171) but our binaries of Node.js 18.12.1 contain ICU 71.1.
What does node -p process.versions (note the s at the end) print? This is the behaviour you would see with ICU 72.1 (see the same report for Node.js 19: #45171) but our binaries of Node.js 18.12.1 contain ICU 71.1.
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)
Activity
richardlau commentedon Dec 5, 2022
What does
node -p process.versions(note thesat the end) print? This is the behaviour you would see with ICU 72.1 (see the same report for Node.js 19: #45171) but our binaries of Node.js 18.12.1 contain ICU 71.1.stsoib commentedon Dec 5, 2022
stsoib commentedon Dec 5, 2022
What does it mean if it prints
node: '18.12.1'ANDicu: '72.1'?richardlau commentedon Dec 5, 2022
It means whoever compiled your binaries (not us) has either replaced ICU with a newer one or linked to your system ICU.
stsoib commentedon Dec 5, 2022
I see. Let me check with my colleague to confirm this. Thanks for clarifying!
Pacheco95 commentedon Nov 6, 2023
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:
Output:
System info