相关疑难解决方法(0)

具有不对称大写/小写的Unicode字符.为什么?

为什么以下三个字符没有对称的toLower,toUpper结果

/**
  * Written in the Scala programming language, typed into the Scala REPL.
  * Results commented accordingly.
  */
/* Unicode Character 'LATIN CAPITAL LETTER SHARP S' (U+1E9E) */
'\u1e9e'.toHexString == "1e9e" // true
'\u1e9e'.toLower.toHexString == "df" // "df" == "df"
'\u1e9e'.toHexString == '\u1e9e'.toLower.toUpper.toHexString // "1e9e" != "df"
/* Unicode Character 'KELVIN SIGN' (U+212A) */
'\u212a'.toHexString == "212a" // "212a" == "212a"
'\u212a'.toLower.toHexString == "6b" // "6b" == "6b"
'\u212a'.toHexString == '\u212a'.toLower.toUpper.toHexString // "212a" != "4b" …
Run Code Online (Sandbox Code Playgroud)

regex unicode scala lowercase uppercase

11
推荐指数
1
解决办法
1978
查看次数

标签 统计

lowercase ×1

regex ×1

scala ×1

unicode ×1

uppercase ×1