The Turkish I Problem: Why Dotted İ and Dotless ı Break Case Conversion

Turkish has four letters where English has two: i, İ, ı and I. Code that assumes the English pairing drops dots, changes the meaning of words and breaks comparisons. Real JavaScript, Java, PHP and C# output, plus the fixes for writers and developers.

9 min read ToolsBasic
Advertisement icyabmod — admin panel included: update your website yourself, no code
The Turkish I Problem: Why Dotted İ and Dotless ı Break Case Conversion

The Turkish I problem is what happens when software applies the English pairing of i and I to a language that has two separate pairs. In Turkish, dotted i uppercases to İ and plain capital I lowercases to dotless ı. Code that ignores this turns "istanbul" into "ISTANBUL" instead of "İSTANBUL". Run on a machine whose default locale is Turkish, the same kind of code turns the keyword "title" into "TİTLE", and comparisons that passed on the developer's laptop start failing in production. The fix fits in one sentence: convert human-readable text with the rules of its language, and convert identifiers with a fixed, locale-independent rule.

To repair Turkish text right now, the case converter has a Turkish letter option that maps both pairs correctly. The slug generator turns Turkish titles into clean ASCII URLs, the character counter helps when a length check behaves strangely, the text diff checker shows which lines a bulk conversion touched, and the JSON formatter makes a misspelled config key easy to spot. All five run in your browser and never send your text to the server.

Four letters where English has two

English treats i and I as one letter in two sizes. The Turkish alphabet, introduced in 1928, splits that sound in two: a front vowel written with a dot and a back vowel written without one. Each has a capital and a small form, so Turkish ends up with four distinct letters, each with its own Unicode code point.

SmallCapitalCode points (small / capital)UTF-8 bytes (small / capital)Example
iİU+0069 / U+013069 / C4 B0izmir → İZMİR
ıIU+0131 / U+0049C4 B1 / 49ılık (lukewarm) → ILIK

The trap sits in the second row: the ordinary capital I on every keyboard is, in Turkish, the partner of dotless ı, not of dotted i. A program that only knows the English mapping collapses two pairs into one, and what it throws away cannot be recovered. Uppercase "ılık" with English rules, lowercase it again, and you get "ilik", which means bone marrow.

When a dot changes the word

Plenty of Turkish words differ only by that dot: kır (countryside) and kir (dirt), dış (outside) and diş (tooth), sınır (border) and sinir (nerve). A sign reading "SINIR KAPISI" (border gate), lowercased with English rules, becomes "sinir kapisi", roughly the nerve gate. Going the other way, a template that uppercases "diş hekimi" (dentist) prints "DIŞ HEKIMI", and a Turkish reader sees the word for outside. On a shop sign, an invoice or an official letter, the error is not cosmetic. The text is simply wrong.

Where the Turkish I problem shows up in code

For developers the story usually goes the same way: the code passes every test on the build machine and breaks on a server or in a browser configured for Turkish. The table collects the expressions behind most of the trouble, with the output they actually produce.

ExpressionResultWhy
'i'.toUpperCase()"I"JavaScript, locale-independent mapping
'i'.toLocaleUpperCase('tr')"İ"JavaScript with an explicit Turkish locale
'İ'.toLowerCase()i + U+0307Two code points, length 2
/istanbul/i.test('İSTANBUL')falseThe regex i flag does not treat İ as a case variant of i
"title".toUpperCase()"TİTLE"Java, when the default locale is Turkish
"file".ToUpper()"FİLE"C#, when the current culture is tr-TR
strtoupper('şişli')"şIşLI"PHP 8.2 and later convert ASCII letters only

JavaScript: the locale argument decides

In JavaScript, toUpperCase() and toLowerCase() use the locale-independent Unicode mapping. For Turkish rules you have to ask: 'istanbul'.toLocaleUpperCase('tr') returns "İSTANBUL". Called without an argument, toLocaleUpperCase() falls back to the host's default locale, so the same line can behave one way in a browser set to Turkish and another way in one set to English. Pass the language tag explicitly, or choose the locale-independent method on purpose.

Java and the Turkey test

Java's String.toUpperCase() without arguments uses the JVM's default locale. On a Turkish system, "title".toUpperCase() returns "TİTLE" and "TITLE".toLowerCase() returns "tıtle"; the Javadoc for both methods uses exactly these examples. A typical casualty is enum parsing: Status.valueOf(input.toUpperCase()) receives "active", looks for a constant named ACTİVE and throws IllegalArgumentException. This family of bugs is widely known as the Turkey test: if your code still behaves under a Turkish default locale, you have probably handled locales carefully everywhere else too.

The combining dot nobody typed

Lowercasing is sneakier. Because Unicode treats İ as canonically equivalent to a capital I followed by a combining dot above, the locale-independent lowercase mapping keeps the dot and emits a plain i followed by U+0307. In JavaScript, 'İstanbul'.toLowerCase() returns a string nine units long that renders like an ordinary "istanbul", yet 'İstanbul'.toLowerCase() === 'istanbul' is false. PHP's mb_strtolower('İ') produces the same pair, bytes 69 CC 87 in UTF-8. NFC normalization does not remove the mark, because no single code point combines i with that dot. With an explicit Turkish locale, the mark never appears.

Case-insensitive search and matching

Search boxes and duplicate checks fail in the same places. The pattern /istanbul/i does not match "İSTANBUL", with or without the u flag. Lowercasing both sides with Turkish rules fixes that and opens another hole: a user without a Turkish keyboard types "ISTANBUL", Turkish lowercasing turns it into "ıstanbul", and the match fails again. For user-facing comparison a collator is sturdier: new Intl.Collator('tr', { sensitivity: 'base' }).compare('istanbul', 'İSTANBUL') returns 0. If users skip the dots, build a forgiving search key that folds i, ı, İ and I into one letter, and use it only for matching, never for stored text. In a database, the column's collation settles the same question.

The rule: human text by language, identifiers by invariant rules

Every example above has the same cure: before converting a string, ask who it belongs to. Names, cities and headings that people read need the rules of their language. Strings the program depends on, such as constant names, HTTP header names, SQL keywords, file extensions and JSON keys, must convert identically on every machine.

  • Pass the language explicitly for user text. Use toLocaleUpperCase('tr') in JavaScript and toUpperCase(Locale.forLanguageTag("tr")) in Java, with the tag taken from the content or the user rather than the server.
  • Use invariant conversion for identifiers. That means toUpperCase(Locale.ROOT) in Java and ToUpperInvariant() in C#, whose plain ToUpper() follows the current culture. Python's str.upper() takes no locale at all, so Turkish output needs an explicit replacement step.
  • Compare instead of converting. For fixed keys, StringComparison.OrdinalIgnoreCase in C# is unaffected by culture; for user text, use a collator set to the right language.
  • Run the tests under a Turkish locale. Starting the JVM with -Duser.language=tr -Duser.country=TR flushes out default-locale calls quickly. Seed test data with "title", "INFO", "İstanbul" and "ılık" so all four letters are covered.

Fixing the Turkish I problem in text, no code required

Editors and translators meet the same letters without touching code. Names exported from older systems often arrive in capitals, and English rules mangle them on the way back: "AYŞE YILMAZ" becomes "Ayşe Yilmaz", a misspelling. The case converter has a "Letter rules" setting for this. Turkish maps i to İ and ı to I when uppercasing, and I to ı and İ to i when lowercasing; Standard follows English behaviour. In both modes a capital İ lowercases to a plain i, without the hidden combining dot.

  1. Paste the text into the input box.
  2. Pick UPPER CASE, lower case, Sentence case or Capitalize Each Word under "Convert to".
  3. Switch "Letter rules" to Turkish; on the English page the default is Standard.
  4. Press "Run tool" or Ctrl + Enter.
  5. Convert any English passages separately with Standard rules.
InputStyleTurkish rulesStandard rules
AYŞE YILMAZCapitalize Each WordAyşe YılmazAyşe Yilmaz
istanbulUPPER CASEİSTANBULISTANBUL
ISPARTAlower caseıspartaisparta
INFOlower caseınfoinfo
user idCONSTANT_CASEUSER_İDUSER_ID

The last two rows explain why the setting is a choice rather than always on: English words and code identifiers need Standard, Turkish text needs Turkish. Isparta is a Turkish city whose name starts with the dotless letter, which is why its correct lowercase looks odd to English eyes. Sentence case also lowercases proper nouns, so restore those capitals by hand.

Checking a bulk conversion

Paste the old and new versions into the text diff checker. It aligns lines with the Myers algorithm and lists changed lines by number; when two lines look identical but are flagged as different, an invisible combining dot is the likely culprit. The character counter, by contrast, counts what you see and treats a combining mark as part of its letter. If a "30 characters maximum" form rejects text the counter puts at 28, the form is probably counting code units.

Slugs, file names and config keys

URLs and file names need ASCII equivalents, not just a case change. The slug generator turns "İstanbul'da Kış Tatili" into istanbul-da-kis-tatili: it lowercases, maps ı, ş, ç and their neighbours to plain Latin letters, and replaces spaces and punctuation with hyphens. In configuration files, the JSON formatter puts each key on its own line with two-space indentation, so a stray USER_İD produced on a Turkish machine stands out at a glance.

Frequently asked questions

Does this affect languages other than Turkish?

Azerbaijani uses the same dotted and dotless pairs, and Unicode's special casing data lists Turkish and Azerbaijani together. That is why toLocaleUpperCase('az') also produces the dotted capital. Most other languages written in the Latin alphabet follow the English pairing.

Should English text keep the dot in İstanbul?

English-language publications conventionally write Istanbul and Izmir without the dot. Personal names are a different matter: follow the spelling the person uses, and keep Turkish spelling inside quoted Turkish text.

Is my text sent anywhere when I use the case converter?

No. The conversion runs in JavaScript inside your browser tab, and the page only increments an anonymous usage counter. There is no length limit beyond your browser's memory.

For related reading, the character limits guide explains why the same text gets counted differently from one system to the next, working with JSON data covers naming discipline for keys, CSV vs JSON deals with regional settings when spreadsheets meet data files, and what is Base64 shows how raw bytes become portable text.

Related tools

Advertisement Kelivo — a word game by icyabmod, on Google Play and the App Store

More articles

Blog Posts
Advertisement icyabmod — get a website for your business, design it on a live demo

Blog Posts