18 comments

[ 2.9 ms ] story [ 54.7 ms ] thread
I'm not sure why, but doing a Google search for that character gives interesting results
DDG gave me nothing but the Wikipedia snippet for "Zero-width space"
(comment deleted)
> The button is tested in chrome browsers, if you use another browser it may not work for you.

It doesn’t work in Safari on iOS, FWIW.

Tiny nitpick: U+200B is a Unicode character, not necessarily UTF-8.
\u{200B} also has nothing to do with UTF-8. But I guess the inherent complexity with Unicode and its encodings means that most people will not care to understand how everything relates to each other.
My understanding: Unicode is the dictionary maps codepoints (e.g. `0x200B`) with characters (e.g. ` `) and UTF-8 is a way to encode those codepoints with 1-4 bytes per character. Is that right?
Pretty much. The charset (e.g. Unicode) just maps numbers to characters, and the encoding (e.g. UTF-8) translates sequences of numbers to bytes (and vice versa).

Unfortunately, there's a lot of blurred lines and loose usage of terminology due to misunderstandings and historical baggage (e.g. ambiguous usage of "charset", Microsoft's usage of "Unicode", "ASCII" used to refer to both charset and encoding, etc.) which contributes to the confusion.

It worked in Firefox Developer Edition.

Then I was able to paste it into SublimeText. I pasted it several times. SublimeText says the line is 6 characters long, but the cursor is still at the left edge! Then I copied that line, and my clipboard viewer shows 14 bytes for the Unicode entry, 12 bytes for the 6 characters and a two null bytes. As expected, the characters survive being saved with Trim Trailing Whitespace enabled. Reopening the file with a single-byte encoding (I tried Windows 1252) showed the characters. My hex viewer shows 6 occurrences of E2 80 8B.

If only Rudy Giuliani had known about this he might not have had someone "invade" his text on Twitter.
It's worth noting that last time I tried, you can't use this character to tweet a seemingly blank tweet. Twitter correctly disallows this as it would if you tried to tweet a normal space character and nothing else. However, there are plenty of other non-printing unicode characters that you can still use to tweet a seemingly empty tweet.

Hacker News also disallows this in its comments. YMMV with other non-printing characters.

I wonder what the underlying reasons for the differences is from text field to text field.
You can actually enter the character in this textbox, but they probably strip it out when posting.
It's definitely done on the backend with Twitter. Probably HN, too.
Mostly use of Java as backend or not. It still has probably the best I18n character class support in standard library...
I would suggest using the word joiner character (U+2060) for this purpose. If you use a zero-width space in a hashtag and it ends up at the end of the line, the characters after the ZWS will get broken to the next line. When you use word joiner, this will not happen and the whole word will stay connected. Example: https://imgur.com/0DposDa