Purpose: collect Tcl code specific to the Japanese culture. Part of a series that started with [Things British] ---- '''Nengo calculation''': The Japanese calendar starts counting years from 1 with each accession of an emperor, who baptizes his era with a two-Kanji name, ''nengo'' (see for example http://japanesesword.homestead.com/files/kanji/nengo.htm). The following nengo are important for recent times: Meiji 1868-1911 Taisho 1912-1925 Showa 1926-1988 Heisei 1989- For these four eras (and four more free positions), Unicodes have been allocated that render both Kanji into one character. (One might of course also render the two separately, from the regular CJK set). The windows font "Arial Unicode MS" has these four characters, so the following code was possible: proc nengo {{year ""}} { # convert an AD year (default: this) to nengo style if {$year==""} {set year [clock format [clock seconds] -format %Y]} if {$year<1868} { error "cannot convert year $year, prior to 1868" } elseif {$year<1912} { incr year -1867; set nengo \u337E ;# Meiji } elseif {$year < 1926} { incr year -1911; set nengo \u337D ;# Taisho } elseif {$year < 1989} { incr year -1925; set nengo \u337C ;# Showa } else { incr year -1988; set nengo \u337B ;# Heisei } return $nengo$year } ;# RS Richard is only partly right here. The year 1912 is Meiji 45 Nen until 30 July (7 Gatsu 30 Hi) and Taisho 1 Nen thereafter; similarly, the year 1926 is Taisho 17 Nen until 25 December (12 Gatsu 25 Hi) and Showa 1 Nen thereafter, and 1989 is Showa 64 Nen for January 1-7 (1 Gatsu 1--7 Hi) and Heisei 1 Nen afterward. The era changes with the death of an emperor. --[Kevin Kenny] ---- '''[Japlish]''': a functional converter from ''Romaji'' (7-bit ASCII letters for ''hiragana'' and ''KATAKANA'', the two syllabic writing systems used in Japan) to the corresponding Unicodes, plus a handful of Kanji words - add more if you need them... ---- [i18n - writing for the world] - [Arts and crafts of Tcl-Tk programming]