Re: Will Lua kernel use Unicode in the future?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Will Lua kernel use Unicode in the future?
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2005年12月29日 15:45:27 -0200
> It allows you to add "incidental" characters without the need for a
> fully functional editor for that language.
Thanks for the explanation. Anyway, if the point is "incidental" use,
those that need may set an auxiliary function and write code like
this:
x = U"this is pi: U+003C0"
with U defined appropriately:
function L (s)
return string.gsub(s, "U+(%x+)", function (n)
n = tonumber(n, 16)
if n <= 127 then return string.char(n)
elseif n <= 2047 then
return string.char(192 + n/64, 128 + n%64)
elseif ...
end)
end
-- Roberto