When I use "for" to read each line from 1.txt in UTF-8 format, it will be garbled. How to get the batch to correctly recognize UTF-8 encoded files?
for /F "tokens=*" %%f in (1.txt) do echo %%f
pause
When I use "for" to read each line from 1.txt in UTF-8 format, it will be garbled. How to get the batch to correctly recognize UTF-8 encoded files?
for /F "tokens=*" %%f in (1.txt) do echo %%f
pause
Use this:
for /F "tokens=* delims= " %%f in ('type 1.txt') do echo %%f
This will really work because type command reads lines from a text file, no matter what encoding is it.