2

Ive tried pasting this character: ☢ into a txt file,but when I use TYPE,it doesn't show the symbol? Is there a certain code page? Tried different encoding options. I know about the CHCP command and tried different pages.

  • 4
    that's not an ascii code. there's never been a nuke symbol in ascii. that'd be a utf character... – Marc B May 14 '15 at 15:00
  • This is not an ASCII character, this is UTF8. Make sure your encoding is UTF8. If I paste it into an UTF8 document it is shown, it doesn't work with other encoding. EDIT: beaten by 25 seconds – valepu May 14 '15 at 15:00
  • try to use: `chcp 65001` which will set encoding to `UTF8` – pes502 May 14 '15 at 15:01

2 Answers2

3

As Josep indicates, the text file containing the UTF-8 character has to be encoded in UTF-8 with BOM.

Also, your console font has to include that character. The default fonts don't. I just tested DejaVu Sans Mono, and it works. See this page for instructions on how to add a TrueType font to the cmd console.

Finally, you can get around messing with the code page garbage by invoking powershell. That way you don't have to mess with scraping the current code page, changing it to 65001, doing your thing, then restoring back to original. Just do this:

powershell "gc nuke.txt"

... where nuke.txt contains ☢


Edit: Since you're unable to install new fonts on your computer, the only solution is ascii art.

   ___
   \_/
.--,O.--,
 \/   \/
rojo
  • 24,000
  • 5
  • 55
  • 101
1

You have to make sure your file has the UTF8 BOM (Use Notepad++ or the option suggested in the answers below), then you may need to change the character set of your console with chcp 65001, see this answers for more information:

Community
  • 1
  • 1
Josep Valls
  • 5,483
  • 2
  • 33
  • 67