Will Javascript's String prototype method toUpperCase()
deliver the naturally expected result in every UTF-8-supported language/charset?
I've tried simplified chinese, south korean, tamil, japanese and cyrillic and the results seemed reasonable so far. Can I rely on the method being language-safe?
Example:
"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス".toUpperCase()
> "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス"
Edit: As @Quentin pointed out, there also is a String.prototype.toLocaleUpperCase()
which is probably even "safer" to use, but I also have to support IE 8 and above, as well as Webkit-based browsers. Since it is part of ECMAScript 3 Standard, it should be available on all those browsers, right?
Does anyone know of any cases where using it delivers naturally unexpected results?