What zero-width characters exist in UTF-8 that are not treated as spaces1? I am particularly interested in those which glyphs that do not render on major browsers: the not-found rectangle should never be shown.
There are many web services that order user entered data alphabetically (eg. Gmail's labels). I would like to use those invisible characters to enforce custom ordering.
1 Treated as spaces: not removed by commonly used implementations of trim
and similar. With the gmail example, U+202F
(Narrow no-break space) is trimmed.
Edit: Only one invisible character should suffice. After all, they may be repeated without having an effect on the visual representation (assuming a lower code ascii text follows):
[char]Z on first position
[char][char]B on second position
[char][char][char]C on third position
Unfortunately, all characters I could think of are either trimmed right away or ignored by sort functions.
Edit: I've browsed through all UTF-8 characters that seemed zero width / invisible and none worked as required. U+0 - U+20
, DEL
, Control chars, even symbols such as U+034F: COMBINING GRAPHEME JOINER (alias CGJ)
, all are treated properly and thus unusable for my purpose. I keep searching though.
You could try the following ones:
U+200B ZERO WIDTH SPACE
U+200C ZERO WIDTH NON-JOINER
U+200D ZERO WIDTH JOINER
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With