You Shipped a Turkish Localization. Now "INFO" Lowercases to "ınfo" and Your String Matching Is Broken.
localizedLowercase and lowercased(with: .current) follow Turkish casing rules, where I lowercases to dotless ı and i uppercases to dotted İ. Here's how that breaks enum parsing, email normalization, file extensions and dictionary keys in Swift apps, why it only shows up after you add a Turkish localization, and the rule that fixes it.
Your Cache Key Says "user-Optional(42)". Swift String Interpolation Wrote It, and Xcode's Fix-It Made It Permanent.
Interpolating an optional into a Swift string produces "Optional(42)" or "nil", not the value. Here's how that ends up in URLs, cache keys, file names and analytics events, why Xcode's String(describing:) fix-it silences the warning without fixing the bug, and how to make optionals in strings impossible to ship.
String(decoding:as:) Never Fails. It Just Quietly Swaps Your Bytes for �.
Swift has two ways to turn bytes into a String and they disagree about failure: String(data:encoding:) returns nil on invalid UTF-8, String(decoding:as:) repairs it with U+FFFD and never tells you. Here's where broken bytes actually come from on iOS (chunked streams, Latin-1 files, BLE packets), how the repair corrupts hashes and signatures, Swift 6's String(validating:as:), and a chunk-safe decoder.
Swift's split() Throws Away Your Empty Fields. Your CSV Import Just Shifted Every Column Left.
Swift's split(separator:) omits empty subsequences by default, so a,,c becomes two fields, not three. Here's how that shifts CSV and TSV columns, why Windows CRLF line endings never split on a newline, how components(separatedBy:) differs, and the safe way to parse delimited lines.
Your List Sorts "Track 10" Before "Track 2" and "Zebra" Before "apple". Swift's < Isn't Alphabetical.
Sorting user-facing strings with < in Swift compares Unicode scalar values: uppercase before lowercase, accented letters at the end, and numbers digit by digit. Here's how localizedStandardCompare, compare(options:locale:) and KeyPathComparator fix it, and when you should keep using <.
One Invisible Character Makes Your App's Text Run Backwards. SE-0559 Finally Lets Swift See It.
U+202E RIGHT-TO-LEFT OVERRIDE can flip usernames, notification text, and file names like invoice_exe.pdf in any iOS app. Here's how bidi spoofing works, how to strip and isolate user text in Swift today, and what SE-0559's new Unicode.BidiClass adds.
Your @Mention Highlight Drifts After Every Emoji. NSRange Doesn't Count What String.count Counts.
String.count counts characters, NSRange counts UTF-16 code units, and mixing them shifts every highlight, regex match, and text field limit after the first emoji. Here's why, and the two initializers that fix it.
Swift's String.count Isn't O(1). It Walks the Whole String Every Time.
Swift's String.count looks like a free property access, but it's not — Unicode-correct grapheme cluster counting makes it O(n). Here's why Swift made that trade, where it actually costs you, and the isEmpty habit that sidesteps most of it.