Is there a way to echo special ASCII symbols such as ░?

372 Views Asked by At

ASCII art in batch could look a lot nicer if their was a way to display things such as ░ without it interpreting it as odd symbols.

1

There are 1 best solutions below

0
On

The typical way to achieve this is by changing the codepage using CHCP 65001 (other characters may require a different codepage).

An alternative for windows 10 users is to use console virtual terminal sequences which allows a limited selection of characters to be printed without changing codepage.

ESC(0 to enable draw character set, ESC(B to disable

@echo off & CLS
 for /F "delims=#" %%a in ('"prompt #$E# & for %%a in (1) do rem"') do set "\E=%%a"
<nul Set /P "=%\E%[1;1Hl%\E%[2;1Hm%\E%[1;2Hk%\E%[2;2Hj a f g j k l m n q t u v w x y z"
<nul Set /P "=%\E%(0%\E%[3;1Hl%\E%[4;1Hm%\E%[3;2Hk%\E%[4;2Hj a f g j k l m n q t u v w x y z %\E%(B"
<nul Set /P "=%\E%(0%\E%[6;4Ha%\E%[7;4Ha%\E%[5;5Hl%\E%[5;6Hw%\E%[5;7Hk%\E%[6;5Ht%\E%[6;6Hn%\E%[6;7Hu%\E%[6;8x%\E%[7;5Hm%\E%[7;6Hv%\E%[7;7Hj%\E%(B"

Output:

VT sequences