Jump to content

Echoing Unicode in batch scripts?


Recommended Posts

There's a text file:

عربي中文(简体)繁體中文版本češtinaελληνικάעִבְרִית日本語한국어portuguêsрусскийTürkçe
I'd like to echo these lines to another file.

This obviously doesn't work:

FOR /F %%A IN (test.txt) DO ECHO %%A
I've searched in the Internet and tried several different methods, including changing the code page go 65001, changing the CMD font to Arial Unicode, changing code page of the text file itself and others. None of them worked though.

Above is just a list of these different language names but normally they appear in many different places in the text file and are surrounded by other text. They may also appear next to each other.

Is there any method proved to work in this case? I don't mind using 3rd party tools if necessary.

Edited by tomasz86
Link to comment
Share on other sites


There may be a way to output it from a script but it would be very specific and not generic.

it would very likely that the method would not be easily transferrable in a different scenario later

Link to comment
Share on other sites

I could have sworn that I had a solution to this somewhere but it might have involved AHK. WIll have to research some past efforts when I get some free time. In the meantime, I hereby subscribe to this thread :)

Note: I seem to recall one issue I had was that I got a script to work but didn't realize it because the text viewer I was using (actually a file explorer at the time) wasn't properly displaying the unicode chars in the first place. So, yeah...check the obvious stuff first :whistle:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...