Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

String.to{Low,Upp}case() gives invalid result #462

Closed
Tracked by #3087
alexlamsl opened this issue Feb 8, 2018 · 8 comments
Closed
Tracked by #3087

String.to{Low,Upp}case() gives invalid result #462

alexlamsl opened this issue Feb 8, 2018 · 8 comments
Assignees

Comments

@alexlamsl
Copy link

The following fails with node-chakracore@8.6.0:

// gives 304 instead
assert.strictEqual("İ".toLowerCase().charCodeAt(0), 105);
// gives 305 instead
assert.strictEqual("ı".toUpperCase().charCodeAt(0), 73);

Discovered in mishoo/UglifyJS#2886 (comment)

Other platforms are working as expected:

  • IE 8~11
  • FireFox 43
  • Safari 5
  • Opera 10
  • Node 0.10~9
@MSLaguana
Copy link
Contributor

Looks like we are also inconsistent between different OS: when I try your examples on Linux, the second case works correctly but the first does not. @jackhorton should we be using ICU for upper/lower casing?

@jackhorton
Copy link
Contributor

Interesting. This is probably a Chakra bug, rather than a Node-ChakraCore bug, so I will make something to track this over there. With that being said, I dont think ICU should be required here, since the whole point of toLocale{Upper|Lower}Case is that they use locale-sensitive casing rules, so we are probably passing some bad flags to the Win32/POSIX APIs that handle the basic comparison.

@alexlamsl
Copy link
Author

Still an issue as of v10.0.0

@jackhorton
Copy link
Contributor

It should only be an issue on Windows. Can you confirm which platform you are running on?

@alexlamsl
Copy link
Author

@jackhorton sorry for missing this detail in the original report – this is indeed tested on Windows 10 (x64).

@alexlamsl
Copy link
Author

I can't confirm whether the issue exists on say Ubuntu, as mishoo/UglifyJS#3087 is blocked by #509, i.e. the process crashed before it can get to the test relevant to this report.

@alexlamsl
Copy link
Author

Still an issue as of v10.1.0 (on Windows)

@alexlamsl
Copy link
Author

Fixed in v10.6.0 - thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants