1

I'm working on the development of a website in my native language, where the uppercase version of letter "i" is "İ". Default string.toUpperCase() method turns "i" into "I", which is a completely different letter (the lowercase version for this one is "ı"). Is there a way to set the default uppercase value for "i", so that I will be able to use toUpperCase() method successfully?

The locale is az_Latn_AZ.

Farid M.
  • 13
  • 4

1 Answers1

0

You can change toUpperCase, like this:

String.prototype.oldToUpperCase = String.prototype.toUpperCase;
String.prototype.toUpperCase = function() {
    return this.split("i").join("I").oldToUpperCase();
}

Now test it like this:

console.log("aaa".toUpperCase());
console.log("aiaia".toUpperCase());
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175