Japanese characters are encoded in 16-bit, i.e. two bytes.
Inside EusLisp, there is no provision to handle Japanese 16-bit
character as a representation of Japanese. They are just regarded
as a series of byte-encoded characters.
The following code will print a Japanese character "AI" that
means love in English, if you are using a terminal
that can display EUC kanji, like kterm.
(setq AI-str
(let ((jstr (make-string 2)))
(setf (aref jstr 0) #xb0
(aref jstr 1) #xa6)
jstr))
(print AI-str)
In a similar manner, (intern AI-str) will create a symbol
with its printname "AI".
(set (intern AI-str) "love")
Conversion functions for different character codes and
Roman-ji representation are provided.
romkan romanji-str [function]
-
- Roman-ji representation is
converted into EUC coded Japanese.
Numbers are converted into pronunciation in hiragana.
romanji kana-str [function]
-
- kana-str which represents
Japanese in hiragana or in katakana coded in EUC
is converted into a roman-ji representation.
English alphabets and numbers are unchanged.
sjis2euc kana-str [function]
-
- kana-str coded in shift-jis
is converted into EUC.
euc2sjis kana-str [function]
-
- kana-str coded in EUC
is converted into shift-JIS.
jis2euc kana-str [function]
-
- kana-str coded in EUC
is converted into JIS coding, which enters kana mode by
ESC\$B
and exits by ESC(J
.
Note that there is no euc2jis function is provided yet.
kana-date time [function]
-
- time is converted a Japanese
date pronunciation represented in roman-ji. The default time
is the current time.
kana-date time [function]
-
- time is converted a Japanese
time pronunciation represented in roman-ji. The default time
is the current time.
hira2kata hiragana-str [function]
-
-
hiragana-str is converted into katakana representation.
kata2hira katakana-str [function]
-
-
katakana-str is converted into hiragana representation.
k-okada
2013-05-21