Q:

ToLowerCase in Chrome vs Firefox

The following gives 0 in Firefox. However it gives -1 in chrome.
var index = "İSTANBUL".toLowerCase().indexOf("is");
console.log(index);

https://jsfiddle.net/81f0yr8w/1/
Chrome puts an extra character when lower casing İ (latin capital letter i with a dot above "\u0130")
"İ".toLocaleLowerCase().length
>2

Is it a normal behaviour?

A:

You can encode the string first then compare it. This will yield the same result in Firefox and Chrome.
// 0 Chrome // 0 Firefox
encodeURIComponent("İSTANBUL".toLowerCase()).indexOf(encodeURIComponent("İS".toLowerCase())) 

The fact that Firefox and Chrome handle it differently is strange. But strange is defined by w3c spec here: https://www.w3.org/TR/charmod-norm/#matchingAlgorithm fwiw, you have to lowercase the string first then encode it. They won't match unless they're the same case first.
Found the Firefox Bug and marked duplicate of [812837]. (https://bugzilla.mozilla.org/show_bug.cgi?id=812837) It was reported in 2011 and it's still open. So I guess it's not a priority.

