V
V
Vladimir Galynsky2016-04-14 11:03:31
cmd/bat
Vladimir Galynsky, 2016-04-14 11:03:31

How to print a text file in the desired encoding in CMD?

Hello. I have a PHP script that creates a text file (data.txt). Then I send it to print using the print command. But krakozyabry is printed. How to fix it? Thanks in advance.
Here is the output in the console:
996201931be547aa8ad380e384f8356c.PNG

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2016-04-14
@res2001

Change the encoding in the console:
chcp <encoding number>
By default, the encoding in the console is 866. The type command doesn't do any conversion (unless the file is in UTF with BOM, in which case it converts UTF to console encoding).

A
Alexander Ananiev, 2016-04-14
@SaNNy32

Save the file immediately in the desired encoding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question