From: David Vallner Date: 2006-11-08T11:23:37+09:00 Subject: Re: Unicode in irb on windows (respectively script/console in instantrails) --------------enig5BAD7457B47BBDA592CE45D0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Austin Ziegler wrote: >=20 > Ack my bad. I had forgotten: you can specify the UTF-8 codepage > (CP_UTF8) with: >=20 > chcp 65001 >=20 > There are some caveats, of course: >=20 > http://blogs.msdn.com/michkap/archive/2006/03/06/544251.aspx >=20 Also the good old combo of "mode con codepage select=3D65001". http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/intl/u= nicode_81rn.asp lists pretty much all the numbers you can use. (The pain of navigating to that on the MSDN website.) Amusingly enough, none of those are even present anymore on WinXP Pro x64. For yet more hilarity, the console is by default set to the DOS OEM codepage of the given locale, instead of the newer ANSI ones that are ISO extensions, which causes great fun when trying to use software that's ever so smart and autodetects my locale as my preferred language (Postgres, assorted GNU stuff being too clever by half) instead of using the OS language version. And "there are some caveats" is an understatement, the UTF-8 support in the console is a sham - I couldn't get a trivial C program using arbitrary combinations of tchar.h, wchar.h, -DUNICODE, cmd.exe, the Windows console, a Cygwin and an MSYS rxvt to do something as daunting as input random characters that aren't shared between Latin1 and Latin2 codepages, store them as multibyte internally, and then write them out to a text file and to the console successfully without one step breaking. The fact whole of CMD broke down in tears from changing that setting is also worth noting - IIRC, had problems doing output redirection to a file and whatnot (I can't play around with this without setting up a virtual machine with a 32bit XP). Basically, the Path Less Annoying is to only use the console for working in your "native" codepage, and use a non-console tool for everything else. end # of rant David Vallner --------------enig5BAD7457B47BBDA592CE45D0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFUT+dy6MhrS8astoRAmPfAJoCUln9FPx8DYExQi7e9msv1vOUNgCfaoXR xcbu7raVVAoX95XQGwpwRLQ= =WsAE -----END PGP SIGNATURE----- --------------enig5BAD7457B47BBDA592CE45D0--