(For Japanese version, see Windowsコンソール)

Using large-character set on REPL

As of Gauche 0.9, pre-compiled Windows binary is available. It is compiled with utf-8 as the internal encoding, so it's capable to handle all Unicode characters.

Unfortunately though, large-character set support on Windows console isn't very great. You'll be disappointed if you expect the same level of unicode capability on unix variants.

The recommended way to use large character set fully in REPL is to run gosh under emacs. Emacs 23 and Meadow 3 just work. Set Emacs variable scheme-program-name to "\\full\\path\\to\\gosh.exe -i". (The -i option is to force interactive mode.)

If you have to use Windows Console, your mileage may vary, depending on your language environment and console property settings. (I checked the following stuff on XP SP3 and Vista SP2.)

If you set your language environment English (or other European languages, I suppose):

Now you can do like this:

gosh> (integer->char 955)

The catch is that, as far as I know, no Unicode-aware fonts for Windows Console support CJK characters.

If you set your language environment Japanese

You're unfortunate.

Your console codepage is set to 932 by default. It is a variation of shift-jis. The font is also set to MS Gothic by default, which includes Japanese characters. So if you convert encodings of output characters to shift_jis, it comes out in Japanese on the console.

You can change the console codepage to 65001 (utf-8) just like the English environemt described above. However, even if your computer has MS Gothic or other Japanese fonts, you cannot use them on the unicode codepage, at least on XP and Vista. I could only find fonts that only had Latin characters and were usable on the codepage 65001.

One way may be to write up a small script that runs REPL with wrapping the input and output ports to convert utf8<->shift_jis. But if you don't have problem with Emacs or Meadow, why bother?

Last modified : 2009/11/23 01:34:06 UTC