1

I'm trying to use a bunch of box drawing characters from UTF-8 to make a grid, and I can't seem to get them to display properly in my terminal. The characters in the text editor vs the output

I've got my text editor encoding set to UTF-8 so I can see the right characters in the editor, but the terminal sets them all to '?'. I'm using gradle to build, and passing -encoding UTF-8 as an argument to the compiler, and I've also run chcp 65001 in the terminal before compiling and running.

Update: By removing -encoding UTF-8 from the compile args it now works for all characters except (\u2501) for some reason, which displays as �?�?�?

SantasSpy
  • 11
  • 4
  • Does this answer your question? [How to config visual studio to use UTF-8 as the default encoding for all projects?](https://stackoverflow.com/questions/41335199/how-to-config-visual-studio-to-use-utf-8-as-the-default-encoding-for-all-project) – sorifiend Jun 15 '22 at 04:10
  • @sorifiend That’s for another product and another problem, no relation here – Sami Kuhmonen Jun 15 '22 at 04:13
  • No unfortunately. That seems to be more about encoding the source file rather than the characters in the terminal I think. Either way none of the answers there seemed to work. – SantasSpy Jun 15 '22 at 04:15
  • The issue shouldn't be the VS Code terminal, but rather your source files themselves. It is also generally best practice not to type the unicode directly into your project, but rather to use the unicode code, for example, instead of `"■"` in code, you would use `"\u25A0"` – sorifiend Jun 15 '22 at 04:16
  • I changed some characters to the proper code instead of the symbol, but that still didn't work and it was displayed as `?`. Also this is just a personal project for some practice for myself, so having `┃` display instead of `\u2503` is alot more helpful in this specific case. – SantasSpy Jun 15 '22 at 04:21
  • What's the name of the font you're using? Does it have glyphs for those codepoints? – g00se Jun 15 '22 at 08:05

0 Answers0