Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

chcp 65001 in cmd prompt

1,951 views
Skip to first unread message

Tim

unread,
May 16, 2008, 1:07:46 PM5/16/08
to
Running XP I have my command prompt font set to the True Type Lucida
console. Type

chcp 65001

clears and resizes the window, which is encouraging. But when I
attempt to display some simple kanji encoded in UTF-8 with

type filename (it contains the 3 kanji for 'nihongo')

I just get three 'missing glyph' boxes.

I know that the glyphs are present since I have my machine set to use
Japanese /SJIS for non Unicode programs. In the command box chcp shows
me that I have 932 and displaying a file with the same three
characters in SJIS displays correctly.

Can I rectify this?

Tim

Mihai N.

unread,
May 17, 2008, 12:50:35 AM5/17/08
to
> Running XP I have my command prompt font set to the True Type Lucida
> console.
...

> I just get three 'missing glyph' boxes.
That is because Lucida console does not contain any Japanese glyphs.


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

Tim

unread,
May 19, 2008, 8:45:14 AM5/19/08
to
On May 17, 12:50 am, "Mihai N." <nmihai_year_2...@yahoo.com> wrote:
> > Running XP I have my command prompt font set to the True Type Lucida
> > console.
> ...
> > I just get three 'missing glyph' boxes.
>
> That is because Lucida console does not contain any Japanese glyphs.

So why does it display correctly when leaving the code page as 932 and
displaying the dame data in 932? Is it missing the UTF-8 CMAP?
I discovered that PC's sold in Japan can change the font to MSGothic,
which does display the UTF-8 correctly.

Tim

Tim

unread,
May 19, 2008, 9:12:09 AM5/19/08
to
Let me ask a follow up question.
On my machine when changing the font for Command Prompt the only True
Type choice shown is Lucida Console. On my colleagues Japanese machine
the only choice was MS Gothic. What controls the font to be shown
here? Is it restricted to one only? I know that it must be fixed
width, but I have a numbed or fixed width fonts (including MS Gothis)
on my system.

Tim


Mihai N.

unread,
May 20, 2008, 1:00:30 AM5/20/08
to
> So why does it display correctly when leaving the code page as 932 and
> displaying the dame data in 932? Is it missing the UTF-8 CMAP?

Because it is "magically" replaced by MS Gothic.
Just take a look here (and look for a key called "932"):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Console\TrueTypeFont

Tim

unread,
May 20, 2008, 11:15:55 AM5/20/08
to
On May 20, 1:00 am, "Mihai N." <nmihai_year_2...@yahoo.com> wrote:
> Because it is "magically" replaced by MS Gothic.
> Just take a look here (and look for a key called "932"):
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> NT\CurrentVersion\Console\TrueTypeFont

Thanks for your answers Mihai - I do have some more related questions.

- Can I change the console font to one that does have glyphs for some
reasonable selection of Unicode - the primary CJK rage for example?
- I experimented with that registry setting. Changing the entry for 0
- to MS Gothic, then to Lucida Sans Unicode - resulted in no TT font
showing in the font selection box for command prompt
- Also tried adding a registry key called 65001 mapped to the above wo
in the hope that it would 'magically' change to that font, but to no
avail.

Tim

Mihai N.

unread,
May 21, 2008, 1:00:20 AM5/21/08
to
> - Can I change the console font to one that does have glyphs for some
> reasonable selection of Unicode - the primary CJK rage for example?
> - I experimented with that registry setting. Changing the entry for 0
> - to MS Gothic, then to Lucida Sans Unicode - resulted in no TT font
> showing in the font selection box for command prompt

There is a trick that allows you for more than one font:
http://www.hanselman.com/blog/UsingConsolasAsTheWindowsConsoleFont.aspx

But the fonts you can use have to pass very strict requirements:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q247815
None of the fonts you tried passes the test.
But Consolas has a better Unicode coverage than Lucida.
And Code2000 also works (shareware, 5$, worth it)
http://www.code2000.net/code2000_page.htm


> - Also tried adding a registry key called 65001 mapped to the above wo
> in the hope that it would 'magically' change to that font, but to no
> avail.

65001 will not work. Only OEM code pages are ok.

Tim

unread,
May 21, 2008, 10:33:02 AM5/21/08
to
Thanks again Mihai,

I have it working with Consolas, but not Code2000. Unfortunately
Consolas also does not have the Kanji fonts.
Do you have Code2000 installed as a console prompt font?

- Tim

Mihai N.

unread,
May 22, 2008, 2:22:52 AM5/22/08
to
> Do you have Code2000 installed as a console prompt font?

I had it once, if memory does not fail me.
But I did not quite like it, and I don't remember being able to see the Kanji

0 new messages