Home > Blockchain >  Why is \v not adding vertical tab in lua 5.3.6?
Why is \v not adding vertical tab in lua 5.3.6?

Time:09-01

print('hello\vworld')

Does not print as intended. ♂ is printed instead of the vertical tab, i.e., hello♂world Here's an image of the output in the terminal. image

CodePudding user response:

Lua is printing an ASCII or UTF-8 vertical tab - 0x0B hex, 11 decimal - as requested, but your PowerShell is set to a different encoding ("code page"). It's probably "DOS Latin 1" (850), "DOS Latin US" (437) or similar. On these code pages, 0x0B represents the Mars symbol.

The chcp command shows which code page is active. You can use the "magic incantation" from this answer to change the code page of your PowerShell to UTF-8.

  • Related