Turkish Uppercase İ and I Rules: Software Casing Guide
Master Turkish uppercase İ and I rules in software. Learn Unicode points, toLocaleUpperCase tricks, database collations, and avoid casing bugs with our guide.
By Candemsoft6 min read
Contents
- 01What Are the Turkish Uppercase İ and I Rules?
- 02Unicode Anatomy: Code Points of the Four I's
- 03Frontend and JavaScript Solutions
- 04Regular Expressions and Unicode Property Escapes
- 05Backend Frameworks: Python, Go, Java, and C#
- 06Database Collations and Search Indexing
- 07Candemsoft's Real-World Experience and Candemkey
- 08Frequently Asked Questions
Short answer: Turkish features four distinct characters: lowercase i, uppercase İ, lowercase ı, and uppercase I. English-centric software engines assume 'i' maps to 'I', which breaks Turkish string conversions across user interfaces, search indices, and validation logic. Resolving these issues requires locale-aware implementations such as toLocaleUpperCase('tr') in JavaScript, unicode.TurkishCase in Go, Locale.forLanguageTag("tr-TR") in Java, and proper database collations rather than generic CSS transformations.
🛠️ Free Online Tool: Fix uppercase and lowercase Turkish character mismatches instantly in your browser with our Turkish Case Converter Tool.
What Are the Turkish Uppercase İ and I Rules?
Searches for "turkish capital i", "turkish dotless i uppercase", and "turkish case conversion" point to a classic software edge case: the breakdown of standard ASCII assumptions in the Latin alphabet.
In English, casing involves a single letter pair:
- Lowercase
iuppercases to dotlessI.
In Turkish, dotted and dotless letters represent two separate phonemes with distinct pronunciations and meanings:
- The Dotted Pair: Lowercase
imaps to dotted uppercase İ. - The Dotless Pair: Lowercase
ımaps to dotless uppercase I.
When software algorithms apply standard ASCII conversions without locale awareness, they trigger severe functional bugs:
ilişkiturns intoILISKIorILIŞKIinstead of the correctİLİŞKİ.IŞIKturns intoisikorişıkinstead of the correctışık.istanbulturns intoISTANBUL, which Turkish readers pronounce with an unnatural "uh" sound instead ofİSTANBUL.DİYARBAKIRturns into corrupted combinations likedi̇yarbakirrather thandiyarbakır.
This mismatch is more than an aesthetic defect: it invalidates search query tokens, breaks user logins, disrupts unique constraints, and can introduce security bypasses.
Unicode Anatomy: Code Points of the Four I's
Within the Unicode standard, each of the four letters holds an independent code point:
| Letter | Definition | Unicode Point | UTF-8 Bytes |
| :--- | :--- | :--- | :--- |
| İ | Latin Capital Letter I with Dot Above | U+0130 | 0xC4 0xB0 |
| i | Latin Small Letter I | U+0069 | 0x69 |
| I | Latin Capital Letter I | U+0049 | 0x49 |
| ı | Latin Small Letter Dotless I | U+0131 | 0xC4 0xB1 |
The Normalization Trap: NFC vs. NFD
Unicode allows accented letters to be encoded in two formats:
- NFC (Composition): Dotted capital
İis stored as a single character (U+0130). - NFD (Decomposition): Dotted capital
İis split into uppercaseI(U+0049) and a combining dot above (U+0307).
While both forms render identically on screen, binary comparisons (textA === textB) evaluate to false. Always apply normalize('NFC') before indexing, saving, or hashing Turkish strings.
Frontend and JavaScript Solutions
1. Why toUpperCase() and toLowerCase() Break
JavaScript's legacy string methods follow invariant ASCII rules:
// Problematic approach:
"istanbul".toUpperCase(); // "ISTANBUL" -> Incorrect
"İSTANBUL".toLowerCase(); // "i̇stanbul" -> Generates combining dot U+0307
// Robust, locale-aware approach:
"istanbul".toLocaleUpperCase("tr-TR"); // "İSTANBUL"
"İSTANBUL".toLocaleLowerCase("tr-TR"); // "istanbul"
"IŞIK".toLocaleLowerCase("tr-TR"); // "ışık"
2. The Danger of CSS text-transform: uppercase
CSS text-transform: uppercase delegates casing to the browser rendering engine, which inspects <html lang="...">:
- If
<html lang="tr">is set, browsers uppercaseistanbultoİSTANBULcorrectly. - In multilingual setups where components render without explicit language context, browsers default to English, corrupting Turkish text to
ISTANBUL. - Assistive technologies may interpret CSS-capitalized words as individual acronym letters.
For predictable user interfaces, execute casing operations in application logic rather than relying solely on stylesheet transformations.
Regular Expressions and Unicode Property Escapes
Validating Turkish strings with /[a-zA-Z]/ rejects legitimate names containing 'ç, ğ, ı, ö, ş, ü, İ, I'.
Modern ECMAScript provides Unicode property escapes (\p{L}) paired with the u flag:
const turkishNamePattern = /^[\p{L}\s]+$/u;
turkishNamePattern.test("İpek Işık"); // true
\p{L}: Matches any letter across global scripts.\p{Lu}: Matches uppercase letters (İandIincluded).\p{Ll}: Matches lowercase letters (iandıincluded).
Backend Frameworks: Python, Go, Java, and C#
Python
Standard Python string methods do not incorporate linguistic variations:
"i".upper() # Returns 'I' instead of 'İ'
"ı".upper() # Returns 'I'
# Both yield 'I', producing unintended equality collisions: 'i'.upper() == 'ı'.upper()
Implement custom mapping lookups or rely on the PyICU library for accurate Turkish casing.
Go (Golang)
Go handles localization through its standard unicode package:
import (
"strings"
"unicode"
)
upper := strings.ToUpperSpecial(unicode.TurkishCase, "ilişki") // "İLİŞKİ"
lower := strings.ToLowerSpecial(unicode.TurkishCase, "IŞIK") // "ışık"
Java
Unparameterized .toUpperCase() in Java is the classic root of the "Turkish-I Problem":
String upper = "istanbul".toUpperCase(Locale.forLanguageTag("tr-TR")); // "İSTANBUL"
String lower = "IŞIK".toLowerCase(Locale.forLanguageTag("tr-TR")); // "ışık"
C# (.NET) and the Turkish-I Security Vulnerability
In .NET on Turkish servers, "file".ToUpper() produces "FİLE". If security filters inspect authorization paths against "FILE", the check fails to match, allowing unauthorized requests to pass.
For protocol headers and internal route validations, always enforce StringComparison.OrdinalIgnoreCase or ToUpperInvariant(). Use new CultureInfo("tr-TR") for human-facing output.
Database Collations and Search Indexing
Database query matching requires proper collation configurations:
- MySQL / MariaDB: Use
utf8mb4_turkish_ci. This guarantees that queries forışıkmatchIŞIKwithout conflicting withişık. - PostgreSQL: Initialize databases with
LC_COLLATE = 'tr_TR.utf8'or appendCOLLATE "tr-TR-x-icu". - SQLite: Default
COLLATE NOCASEoperates purely on ASCII characters. Normalize strings at the application layer before storing them in SQLite indices.
Candemsoft's Real-World Experience and Candemkey
We tackled these intricate morphological and character challenges while developing Candemkey, our Turkish AI-powered keyboard application. Candemsoft's Candemkey (Candemkey Case Study) integrates deep natural language understanding to disambiguate accents and casing errors in real-time.
Our engineering team applies strict internationalization (i18n) standards across custom web development, mobile application development, and enterprise AI solutions. You can also explore our technical deep dive into Turkish Character and OCR Challenges.
Frequently Asked Questions
1. What are the Unicode code points for the Turkish capital İ and small ı?
The Turkish dotted capital İ is U+0130, and the dotless small ı is U+0131. Standard English dotless capital I is U+0049, and dotted small i is U+0069.
2. Why should developers avoid toUpperCase() for Turkish strings in JavaScript?
Standard toUpperCase() maps lowercase "i" to dotless "I", turning "istanbul" into "ISTANBUL". Developers should supply explicit language tags via toLocaleUpperCase('tr-TR').
3. How does the "Turkish I Problem" create security vulnerabilities?
When internal security checks convert strings to uppercase on a Turkish operating system, "file" becomes "FİLE". Rules checking against "FILE" will bypass because strings differ in binary memory.
4. Why is CSS text-transform: uppercase unreliable for Turkish typography?
CSS transforms depend on browser environment settings and the <html lang> attribute. If missing, letters capitalize incorrectly, and screen readers may spell words out letter by letter.
5. How should databases be configured for Turkish case-insensitive searches?
For MySQL or MariaDB, apply utf8mb4_turkish_ci. In PostgreSQL, configure ICU Turkish collations (tr-TR-x-icu). For SQLite, normalize strings at the application tier prior to persistence.
