有没有办法使用 JavaScript 更改字符的默认大写值?

Is there a way to change default uppercase value of a character using JavaScript?

我正在用我的母语开发一个网站,其中字母 "i" 的大写版本是“İ”。默认 string.toUpperCase() 方法将 "i" 变成 "I",这是一个 完全 不同的字母(这个字母的小写版本是“ı”) .有没有办法设置 "i" 的默认大写值,以便我能够成功使用 toUpperCase() 方法?

语言环境是 az_Latn_AZ。

您可以像这样更改 toUpperCase

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

现在这样测试:

console.log("aaa".toUpperCase());
console.log("aiaia".toUpperCase());