Wednesday 30 July 2003

Japanese Text

これは日本語のテキストです。読めますか?

If the characters above look like the ones in this illustration

Japanese text: kore wa nihongo no tekisuto desu. yomemasu ka? (This is Japanese text. Can you read it?)

then you have Japanese support installed or enabled in your OS. If not, and you’d like to be able to see the Japanese characters, you’ll need to install or enable Japanese support.

Jim Breen, coordinator of the EDICT Project (Japanese-English dictionary), has a helpful Japanese page, with lots of information about his various dictionary projects and Japanese computing (from which I’ve extracted some of the following links).

Note that the processes for enabling Chinese and/or Korean support are similar to those described for Japanese.

Reading Japanese text on a Windows PC

If you are using a non East Asian version of Windows, the procedure for setting up your PC to read and write Japanese depends on the flavor of Windows you are running.

Users of Windows 95/98/ME must install the Microsoft Global IME (Input Method Editor) and associated fonts. Users of Windows 2000 and Windows XP Pro do not have to download the IME or fonts, although they will need to install them since they are not installed by default.

The most complete set of instructions is available at:

Side-by-side instructions for Windows XP Pro and Windows 2000 are available at:

Reading Japanese text on a Macintosh

Although I started using Japanese on the Macintosh in the late eighties, I haven’t used a Macintosh for a long time. These instructions will probably be enough to get you going:

Reading Japanese text on a Linux system

Japanese just seemed to work automatically when I installed Red Hat Linux. Information about Japanese support in SuSE Linux, which—according to Jim Breen—applies to other Linux distributions too, is available here:

Creating CJK content in Movable Type

Publishing Movable Type posts containing CJK characters is a little more complicated. There is some background material in Trevor Hill’s post Asian Languages… and mine on Enabling CJK Language Support (particularly the comments). In summary, you will need to:

  1. Modify your mt.cfg file so that MT does not use the Perl module HTML::Entities to encode characters into HTML entities.
  2. Modify mt.cfg to override the default character encoding (based on your “Preferred Language.”
  3. Modify the send_http_header in lib/MT/App.pm as suggested by Trevor Hill in the MT forum.

Specifically, you will need to:

  1. Find the line in mt.cfg that says
    # NoHTMLEntities 1
    and remove the # so that it reads
    NoHTMLEntities 1
  2. Find the line in mt.cfg that says
    # PublishCharset Shift_JIS
    and modify it to read
    PublishCharset UTF-8
  3. Find the sub send_http_header code block in lib/MT/App.pm and replace it with:
    sub send_http_header {
    my $app = shift;
    my($type) = @_;
    $type ||= 'text/html; charset=utf-8';
    # if (my $charset = $app->{charset}) {
    # $type .= "; charset=$charset"
    # if $type =~ m!^text/! && $type !~ /\bcharset\b/;
    # }
    if ($ENV{MOD_PERL}) {
    $app->{apache}->send_http_header($type);
    } else {
    $app->{cgi_headers}{-type} = $type;
    print $app->{query}->header(%{ $app->{cgi_headers} });
    }
    }

After that, all you have to do is generate CJK text in a Unicode-compliant application and paste it into MT’s Entry field.

Permalink | Comments (15)

© Copyright 2007 Jonathon Delacour