Capitalize/decapitalize only ASCII characters across project

Use {de,}capitalizeAsciiOnly and to{Lower,Upper}CaseAsciiOnly where
possible, and stdlib's functions with Locale.US everywhere else.

Otherwise, if the default system locale is Turkish, the capital latin
letter "I" is transformed in toLowerCase to "ı" (see
https://github.com/JetBrains/kotlin/blob/66bc142f92085047a1ca64f9a291f0496e33dd98/libraries/stdlib/jvm/test/text/StringJVMTest.kt#L119),
which for example breaks the codegen for `intArrayOf` in
KT-25400/KT-43405.

Similarly, lower case latin letter "i" is transformed to "İ".

 #KT-13631 Fixed
 #KT-25400 Fixed
 #KT-43405 Fixed
This commit is contained in:
Alexander Udalov
2020-11-17 20:26:19 +01:00
parent 5d4b0b19d4
commit 77a9d14f93
53 changed files with 173 additions and 121 deletions
@@ -30,6 +30,7 @@ import org.xml.sax.SAXException
import org.xml.sax.helpers.DefaultHandler
import java.io.IOException
import java.io.Reader
import java.util.*
import javax.xml.parsers.SAXParserFactory
object CompilerOutputParser {
@@ -124,7 +125,7 @@ object CompilerOutputParser {
// We're directly inside the root tag: <MESSAGES>
return
}
val qNameLowerCase = qName.toLowerCase()
val qNameLowerCase = qName.toLowerCase(Locale.US)
var category: CompilerMessageSeverity? = CATEGORIES[qNameLowerCase]
if (category == null) {
messageCollector.report(ERROR, "Unknown compiler message tag: $qName")