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 45 Nen Meiji until 30 July (7 Gatsu 30 Hi) and 1 Nen Taisho thereafter; similarly, the year 1926 is 17 Nen Taisho until 25 December (12 Gatsu 25 Hi) and 1 Nen Showa thereafter, and 1989 is 64 Nen Showa for January 1-7 (1 Gatsu 1--7 Hi) and 1 Nen Heisei 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]