starwing / luautf8

a utf-8 support module for Lua and LuaJIT.
MIT License
406 stars 67 forks source link

add a method utf8.from_mbcs #1

Closed zhuxiaomengjj closed 9 years ago

zhuxiaomengjj commented 10 years ago

For windows user when one using io.read, he/she gets mbcs string which cannot work with utf8 module. So I add a method utf8.from_mbcs to convert from mbcs. The converting code is copied from sqlite3.

starwing commented 10 years ago

this from_mbcs is only Windows-spec, But luautf8 is portable ANSI C written.

it should be another module to do that, but not in luautf8.

if you want GBK conversion, you can see my lgbk module: http://github.com/starwing/luagbk

zhuxiaomengjj commented 10 years ago

Ok. I agree with you. It should be another module to do utf8 convertion.

starwing commented 10 years ago

What do you want? if you just want convert GBK with UTF-8, you can use luagbk, but if you want convert native code-page to utf8, I can write a new module to do that. notice that will only work on Windows, because *nix always use utf8.