Apparently this is more difficult than I thought. Whenever I try to print out non-ASCII font from a Java program, or by using the cat command to print it out directly from a file, all I get is gobblydygook. Here's some things I've already tried:
*Using cmd /u, which supposedly makes it work with Unicode. Yeah, right.
*Switching to Lucida Console from Raster fonts on cmd.exe, which supposedly enables unicode along with cmd /u. No luck.
*Enabling Russian as a language version for non-Unicode programs under the Advanced tab of Regional and Language options in the Control Panel. No dice.
*Windows Power Shell Multilingual Edition. Which doesn't do the trick either.
So how in the world do I get cmd.exe to actually display unicode (non-ASCII Cyrillic in particular) letters? I didn't expect using non-ASCII characters in command line programs would be so problematic.
System is running Windows XP SP3, although I'd like to know if Vista allows non-ASCII characters as well. English version of Windows.
-
-
When I do "cmd /?", the wording in the description of the /U option kind of suggests to me that it's not going to display Unicode on the console.
So... I'd redirect the output to a file and then view the file in your favorite Unicode-capable text editor/viewer.
For example:
java myprog > output.txt
"C:\Program Files\Internet Explorer\iexplore.exe" output.txt
You may need to set the character encoding in Internet Explorer (or whatever you use to view the file). -
Well, the whole point of the program I'm making is to be interactive, so redirecting the output doesn't help me. Notepad does work just fine with Unicode, though.
Any other alternatives for an interactive terminal that has Unicode? I've heard that OSX has it, but that doesn't help a whole lot thanks to Apple's EULA and the fact that it's kinda costly. All I can think of that I'm pretty sure would work is a cmd.exe from a Russian install of Windows. -
What about running directly in Powershell instead of cmd?
-
I'm not sure, but maybe this will have some character encoding capabilities: http://sourceforge.net/projects/console/
If not... I don't know... maybe Linux can handle it? -
-
Yeah the problem isn't cmd.exe. It's the console app that runs the window that those command shells are running in. PowerShell and cygwin (without X11) use the same console window, so that's why it's no different. That's why I suggested Console... I was hoping it might have some char encoding options... but I guess not.
But since you installed cygwin... did you install any of the X11 stuff? You could open up an xterm (or another graphical terminal like rxvt) and do it I think... but you'll have to set an environment variable. See if you can get X running (try typing "startx" at the cygwin/bash prompt)... then if you get the graphical shell, look at the environment vars ("env" or "setenv") and see if there's any locale stuff that tells it the character set...
EDIT: Oh yeah this may be easier if it works... puttycyg replaces the command shell window for cygwin: http://robertmarkbramprogrammer.blogspot.com/2008/08/cygwin-and-putty-wonderful-combination.html
btw you may need to change settings in putty and also locale/charset-related environment vars in the bash environment.
Unfortunately I don't have any of this stuff installed right at the moment.... -
This looks like it may help for Cygwin/X11: http://lists.arabeyes.org/archives/developer/2007/July/msg00125.html
I know it's for arabic but the method should work...you'll need to find an X11 font that has Cyrillic character support though.
Getting non-ASCII text to display in cmd.exe
Discussion in 'Windows OS and Software' started by Apollo13, Sep 17, 2008.