Question

Regardless of whether I use the GNU version of printf--and regardless of whether I'm using the \u2018 escape sequence in printf or in nodejs's console.log--the unicode character is always interpreted as the character with a space following it.

Any ideas on how to get this behavior to stop?

Was it helpful?

Solution

As it turns out the problem was an option that I had set in iTerm2. When you have the following option set for your iTerm2 profile, \u2018 is interpreted as an ambiguous-width char and so is considered to be double-width, but since it isn't an double-width character, such as a kanji, a space gets appended to it.

Just make sure that you have the following option unchecked: enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top