\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.
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.
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 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
18 comments
[ 2.9 ms ] story [ 54.7 ms ] threadIt doesn’t work in Safari on iOS, FWIW.
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.
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.
Hacker News also disallows this in its comments. YMMV with other non-printing characters.