[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua with chinese character set
- From: David Given <dg@...>
- Date: Thu, 20 Apr 2006 11:19:16 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
mos wrote:
[...]
> print(string.byte([[砛]],1,2))
> -- out
> 179 92
Yes, patching the parser is perfectly feasible, but Lua fundamentally
likes encodings that degrade gracefully into ASCII --- so if you were to
use an encoding such as UTF-8 rather than GB2312 it might make your life
easier. (Because all non-ASCII UTF-8 characters turn into strings of
high-bit bytes, which Lua will quietly pass through unchanged. You don't
need to special-case them the way you have to with GB2312.)
- --
+- David Given --McQ-+
| dg@cowlark.com | "Those that repeat truisms, are also forced to
| (dg@tao-group.com) | repeat them." --- Anonymous from Slashdot
+- www.cowlark.com --+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFER2Akf9E0noFvlzgRAhjmAJ9t1sfnd3PU6U3It9lLJ/H8O/dTuQCdGd4Q
94iFHxNwtZVLZ53nsOCkUl4=
=xOLD
-----END PGP SIGNATURE-----