タグ

2011年8月7日のブックマーク (2件)

  • lua-users wiki: Lua Unicode

    This is an attempt to answer the LuaFaq : Can I use unicode strings? or Does Lua support unicode? In short, yes and no. Lua is unicode-agnostic and lua-strings are counted, so whenever you can treat unicode strings as simple byte sequences, you are done. Whenever that does not suffice, there are extension modules supplying your needs. You just have to figure out what exactly you mean by "support u

    soltiox
    soltiox 2011/08/07
    tagga氏のジャーナルから。luaでunicodeする時のあれこれ。英文
  • Lua で非本格的に Unicode | taggaの日記 | スラド

    マジにやるときには ICU のバインディングがあるらしいが、 適当な場合は、このページを参照: http://lua-users.org/wiki/LuaUnicode 要するに、今のだいたいの環境だと、 文字列は unsigned char の列になっているはずで、 IO はスルーしてるだけだから文字コードなんか知ったことじゃない、と。 ああ、なんか懐しい雰囲気……。 しかも、文字列検索で | が使えない。 とりあえず、utf8 で処理するための最低限の関数。 あとは UnicodeData.txt から必要な情報だけ選んだテーブルを作れば、なんとかなるか。 -- 文字列から多バイト文字のリストに変換 function mbclist(str) local list = {} for mbc in string.gmatch(str, '.[\128-\191]*') do -- fix

    soltiox
    soltiox 2011/08/07
    [/.j][lua][utf] luaでuft8する時の関数とか