lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Jay Carlson <nop@nop.com> writes:
>  But computers are already pervasive in Japan and the Republic of
> Korea too, and the People's Republic of China is on its way--and the
> CJK written languages are difficult to handle in unextended Lua.

Wait... how are CJK "hard to handle in unextended Lua" ...?

   $ cat > '短歌.lua' << EOF
   > local lfs = require 'lfs'
   > 
   > local tanka_dir = "短歌"
   > 
   > function tanka ()
   >    for file in lfs.dir (os.getenv ("HOME").."/"..tanka_dir) do
   >       author = string.match (file, "^(.*)[.]txt$")
   >       if author then
   >          print ("歌人: "..author)
   >          for line in io.lines (tanka_dir.."/"..file) do
   >             print ("   "..line)
   >          end
   >       end
   >    end
   > end
   > EOF

   $ lua5.1
   Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
   > loadfile "短歌.lua" ()
   > tanka ()
   歌人: 俵万智
      「寒いね」と話しかければ「寒いね」と答える人のいるあったかさ

hmm, seems OK to me...

-miles

-- 
Brain, n. An apparatus with which we think we think.