I thought I’d blather about the console for a bit.
There are three basic kinds of console applications:
Most console applications emit data that is read later, usually in other tools;
Many other console applications emit data that is generally used right in the console;
A few console applications are interactive with the user.
Some people who spend most of their time with the latter two categories might argue about my wording’s claim of common usages, and there are tools that span categories (e.g. using PING’s results in a log file), but overall I believe this categorization holds true.
Now let’s add internationalization and world readiness to the mix.
For the first category, where the end result is primarily for some other app, WR is easy to do and fully support any characters, whether off code page or supplementary or combining or complex.
Everything can just work.
In the latter two categories, and when the first category initially displays in the console, the WR story is pretty bleak.
Even if you are building completely Unicode console apps and are using TrueType fonts, the best you can hope for when you are off code page or supplementary or combining or complex is square boxes — otherwise all you get is usually lots of corrupted display and question marks.
This is especialy true in PowerShell, where for then most part it doesn’t have to be!
Well, it does have to be for legacy CSRSS/cmd based PowerShell, where these limitations are baked into the architecture.
But the Integrated Scripting Environment (ISE), can support it all, whether off code page or supplementary or combining or complex.
The ISE can even do amazing things with those few proud legacy Unicode console applications I mentioned earlier.
Here it is, in the legacy console with raster fonts:
Even Unicode can’t do much with raster fonts!
Let’s try with Consolas:
But let’s try it in the ISE:
Oops, I forgot they stupidly picked Lucida Console as their default font!
Let’s go to Tools|Options… and fix that:
We don’t even have to run WriteLineRight.exe again:
Just one settings change away from magic!
And now my challenge to you PowerShell developers, and you legacy console developers….
Strut your stuff in the ISE, and see what happens.
No offense, but I’m guessing you.aren’t quite World Ready yet….
Source: MSDN Forum