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

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

Closed

Description

@alexlamsl

The following fails with [email protected]:

// 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

Activity

  1. MSLaguana commented on Feb 8, 2018

    @MSLaguana
    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?

  2. jackhorton commented on Feb 9, 2018

    @jackhorton
    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.

  3. self-assigned this
    on Feb 9, 2018
  4. alexlamsl commented on Apr 28, 2018

    @alexlamsl
    Author

    Still an issue as of v10.0.0

  5. jackhorton commented on Apr 29, 2018

    @jackhorton
    Contributor

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

  6. alexlamsl commented on Apr 29, 2018

    @alexlamsl
    Author

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

  7. alexlamsl commented on Apr 29, 2018

    @alexlamsl
    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.

  8. alexlamsl commented on May 26, 2018

    @alexlamsl
    Author

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

  9. alexlamsl commented on Jul 26, 2018

    @alexlamsl
    Author

    Fixed in v10.6.0 - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions