You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Turkish Locale - Potential Header/Key resolution failure due to case-insensitive TreeMap serialization #755
Java's native String.CASE_INSENSITIVE_ORDER internally triggers Character.toLowerCase(). On a Turkish host machine, this converts the capital letter I in "OpenAI-Organization" into a dotless ı, turning it into "openaı-organization".
This causes key lookup failures or broken token states when downstream interceptors (like OkHttp) process standard ASCII headers.
Related Upstream Issue
This is the Java/Kotlin ecosystem equivalent of the localization bug found in the Node SDK.
The TreeMap should enforce a locale-invariant comparator (such as Locale.ROOT) to guarantee strict ASCII/English-based casing rules across all operating systems:
I opened and then closed #817 after verifying the premise.
TreeMap(String.CASE_INSENSITIVE_ORDER) is not affected by Turkish locale: the comparator uses Unicode case mapping (Character.toUpperCase/toLowerCase), not String.toLowerCase(). Under Locale("tr","TR"), header keys still match across case.
Turkish dotted/dotless I only bites locale-sensitive String case folding. Happy to help if there is a different repro (e.g. a code path that lowercases header names with the default locale).
Thanks for the report and for the follow-up verification above. We could not reproduce the reported behavior.
An offline Java check under the Turkish default locale tr-TR passed case-insensitive lookup, replacement, and removal for OpenAI-Organization and OpenAI-Project using TreeMap(String.CASE_INSENSITIVE_ORDER). The stored header names retained their original spelling, and String.CASE_INSENSITIVE_ORDER.compare("I", "i") returned 0.
String.CASE_INSENSITIVE_ORDER uses locale-independent character folding via Character.toUpperCase and Character.toLowerCase. It does not use the default-locale conversion performed by String.toLowerCase(), and comparing keys does not rewrite them. See the Java documentation. This agrees with the earlier reproduction comment and the verification that led to closing #817.
Closing as not reproducible as described. If the failure occurs through another path, please share a minimal runnable example, the SDK and JDK versions, and the exception or failing request details with credentials removed. We can reopen and investigate that example.
Activity
arimu1 commentedon Jul 25, 2026
I opened and then closed #817 after verifying the premise.
TreeMap(String.CASE_INSENSITIVE_ORDER)is not affected by Turkish locale: the comparator uses Unicode case mapping (Character.toUpperCase/toLowerCase), notString.toLowerCase(). UnderLocale("tr","TR"), header keys still match across case.Turkish dotted/dotless
Ionly bites locale-sensitiveStringcase folding. Happy to help if there is a different repro (e.g. a code path that lowercases header names with the default locale).dpiet-oai commentedon Sep 30, 2026
Thanks for the report and for the follow-up verification above. We could not reproduce the reported behavior.
An offline Java check under the Turkish default locale
tr-TRpassed case-insensitive lookup, replacement, and removal forOpenAI-OrganizationandOpenAI-ProjectusingTreeMap(String.CASE_INSENSITIVE_ORDER). The stored header names retained their original spelling, andString.CASE_INSENSITIVE_ORDER.compare("I", "i")returned0.String.CASE_INSENSITIVE_ORDERuses locale-independent character folding viaCharacter.toUpperCaseandCharacter.toLowerCase. It does not use the default-locale conversion performed byString.toLowerCase(), and comparing keys does not rewrite them. See the Java documentation. This agrees with the earlier reproduction comment and the verification that led to closing #817.Closing as not reproducible as described. If the failure occurs through another path, please share a minimal runnable example, the SDK and JDK versions, and the exception or failing request details with credentials removed. We can reopen and investigate that example.