Closed zhuxiaomengjj closed 9 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
Ok. I agree with you. It should be another module to do utf8 convertion.
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.
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.