unicodezero-width-space

Zero-width space vs zero-width non-joiner


What is the difference between zero-width space (U+200B) and zero-width non-joiner (U+200C) from practical point of view?

I have already read Wikipedia articles, but I can't understand if these characters are interchangeable or not.

I think they are completely interchangeable, but then I can't understand why we have two in Unicode set instead of one.


Solution

  • A zero-width non-joiner is almost non-existing. Its only purpose is to split things into two. For example, 123 zero-width-non-joiner 456 is two numbers with nothing in between.

    A zero-width space is a space character, just a very very narrow one. For example 123 zero-width-space 456 is two numbers with a space character in between.