|Summary:||String.prototype.trim removes U+200B from strings.|
|Product:||WebKit||Reporter:||Lasse R.H. Nielsen <lrn>|
|Severity:||Normal||CC:||ap, ggaren, m.goleb+bugzilla, oliver|
|Version:||525.x (Safari 3.2)|
Description Lasse R.H. Nielsen 2014-03-13 02:58:48 PDT
In the current version of Safari on a Mac, the String.prototype.trim function removes "\u200b" characters from the string. That character is not recognized as whitespace by the ECMAScript 5 spec (or the ES6 drafts), and should not be removed. Example code: alert("\u200b".trim().length); // should alert 1, actually alerts 0. Apologies if this has been fixed in a nightly build.
Comment 1 Alexey Proskuryakov 2014-04-29 12:17:12 PDT
Adding this character was intentional, see discussion in bug 26590. Seems like maybe we should remove it now to match the new standard.
Comment 2 Geoffrey Garen 2014-04-29 12:30:40 PDT
Looks like bug 26590 was written to match a draft specification, but no ratified specification ever included u200b, Unicode does not include u200b in the 'Separator, Space' category, and Firefox does not include it either.