Why Do Apps Remove Spaces? How trim() Works
A plain explanation of trim(), the function that deletes normal spaces and lets blank characters through.
The short answer
Apps clean text with trim() before saving it. trim() removes every character classed as a space at the start and end. If nothing is left, the app rejects your message or name. That’s why normal spaces vanish while Hangul Filler stays.
What is trim()?
trim() exists in almost every programming language. In JavaScript it removes normal spaces, tabs, line breaks, every Unicode space character (category Zs) and U+FEFF. PHP’s default trim() only removes ASCII spaces and control characters. So a character can survive in one app and disappear in another.
What gets removed and what stays
Removed by JavaScript trim(): the normal space (U+0020), no-break space (U+00A0), em space (U+2003), ideographic space (U+3000) and U+FEFF. Kept: U+3164, Braille Pattern Blank (U+2800) and zero width space (U+200B). The full table is on the Unicode list page.
It’s not only trim()
Many platforms add their own filters, such as blocking zero-width characters in usernames or stripping U+3164 from names. That’s why a character that worked yesterday can fail today, and why each of our guides lists a backup.
What this means for you
For blank text, use a character that isn’t a space: start with U+3164, then U+2800 if it’s rejected. For clean text with nothing hidden, run it through Remove Invisible Characters before you paste it.
Frequently asked questions
Why does a no-break space sometimes work?
Because that app uses a trim() that only removes ASCII spaces, like PHP’s.
Is zero width space good for a blank name?
Rarely. Many platforms block it; U+3164 works more often.