How a Single ß Can Break Everything
summary
Shows a real bug: username length capped at 30 breaks when emojis and modifiers expand code units and initials generation picks the wrong substring. Explains UTF‑8 vs UTF‑16, Android strings stored as UTF‑16 so astral characters use surrogate pairs and a rocket counts as two code units, a family emoji can be 11 UTF-16 code units. Recommends Android.icu.text.BreakIterator getCharacterInstance to count grapheme clusters, avoid naive regex, and warns about case rules like sharp S → "SS" that change length so an uppercase transform can crash UI limits.
AI-written summary · about
chapters (26)
- 0:00Introduction
- 1:02Username profile picture problem
- 2:50Emojis break text
- 3:10Unicode history
- 4:15Pre-Unicode chaos
- 5:39Unicode code points
- 6:45UTF-8 vs UTF-16
- 7:49Why UTF-8 dominates
- 9:35UTF-16 in Android
- 10:59Early decisions impact
- 12:23Emoji storage
- 13:28Unicode planes
- 14:52Text normalization
- 16:16Graphic clusters mystery
- 17:42Hidden Unicode pitfalls
- 18:05Emoji modifiers
- 19:50Counting clusters on Android
- 20:34Regex fails on Unicode
- 21:39Unicode properties
- 22:01Fixing profile initials
- 22:47Sharp S case mapping
- 24:55More case mapping surprises
- 25:39Zalgo text abuse
- 26:21Unicode bugs
- 26:42Real-world Unicode bugs
- 27:03Conclusion
related talks
23mAndroid U+2764 (❤) Emoji
36mNo More □ — Mastering Emoji on Android
35mNO MORE □ — MASTERING EMOJI ON ANDROID
37mAndroid Text, The Good The Bad and The ugly
21mAndroid Emoji 2021
39mUnderstanding Compose Text Field
23mThe lesser-known world of Spans
40mWhat's New (?) in Android Text Over the Past Few Years
