From: Rudolf Polzer Date: 2002-09-27T18:21:35+09:00 Subject: Re: 'kakasi': different style for hiragana and katakana? Scripsit ille aut illa GOTO Kentaro : > Rudolf Polzer wrote: > > In my kakasi-renamer I want to change filenames to Roumaji as follows: > > > > hiragana > > KATAKANA > > Kanji > > As far as I know, kakasi doesn't have such function. [...] > def eucjp_katakana_to_upcase(str) > katakana_from = "\xa5\xa1" # small a > katakana_end = "\xa5\xf6" # small ke > katakana = /[#{katakana_from}-#{katakana_end}]+/em # em for euc&multiline > str.gsub(katakana){Kakasi::kakasi("-ka -Ka", $&).upcase} > end Thanks! Where can I find an EUC-JP coding table (not containing each single code, but containing all relevant ranges)? > if __FILE__ == $0 > puts eucjp_katakana_to_upcase(ARGF.read) > end > > > Currently I have > > > > if Kconv::guess (name) != Kconv::UNKNOWN > > euc = Kconv::toeuc (name) > > Kconv::guess and Kconv::toeuc uses different algorithms to determine > encoding and "if Kconv::guess (name) != Kconv::UNKNOWN" may not work. I'm using this to prevent changing of file names that just contain German umlaut characters (�, �, �), the German � or the Euro sign (�, \xa4). But I could save the result of Kconv::guess and use this when converting. -- [mpg123d] Just playing: .../albums/vintage/a/09 hesitation.mp3 The math could be slightly incorrect, but it sounds right. RFC 2795