a="|:watch:️ :mobile phone: :mobile phone with arrow: :laptop: :keyboard: :desktop computer: |"
b="|:printer: :computer mouse: :trackball: :joystick: :clamp: :computer disk: :floppy disk: :optical|"
both of these strings should be 98 characters, but when printing with a monospaced font (in my terminal) it shows b
as being longer
terminal output when printing length of each string followed by string
This shouldn’t be an issue but I’m trying to draw a box around some text and this glitch causes the table to be misaligned. Is it possible that the font is not properly monospaced? I am using VS Code for the Web.
Thank you kindly for your time.
2
Answers
I was guessing that one of the chars in
a
is strange. We can see this if we print them:So we can see that at index
8
there is some kind of "zero width" character.We can inspect the char to find its codepoint:
This appears to be Unicode "VARIATION SELECTOR-16": https://www.fileformat.info/info/unicode/char/fe0f/index.htm
Some kind of modifying character that has no printable representation of its own.
try to add one profit to a or copy this and try…