Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

String.prototype.normalize always returns the original string #8957

Closed
devongovett opened this issue Dec 30, 2014 · 1 comment
Closed

String.prototype.normalize always returns the original string #8957

devongovett opened this issue Dec 30, 2014 · 1 comment

Comments

@devongovett
Copy link

Not sure if this is a v8 issue, but it works in Chrome so I thought I'd report here. String.prototype.normalize seems to always return the original string, rather than actually normalizing it. Tested in node v0.11.14. You can run this to confirm (run in node v0.11.14 and Chrome 34+):

String.fromCharCode(7690).normalize('NFD').length // should be 2, returns 1

This is the patch adding support for the method in v8.

Currently, polyfills won't be enabled unless they also test for a correct implementation, breaking code that previously worked under versions of node without any implementation of String.prototype.normalize at all.

Perhaps something with the way ICU is built in node could cause this? I noticed one mention of normalization in #7719. If ICU is not going to be built/linked by default with node, then String.prototype.normalize should also be disabled by default. IMHO it needs to be supported eventually since the method is part of the language, but if fixing the issue is a big deal, disabling it for now would be a fine option I think.

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

No branches or pull requests

2 participants