lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Javier Guerra Giraldez wrote:
[...]
> i find hard to believe that "if you're too lazy to use UTF-8 then be
> happy with pure ASCII" is not an acceptable requirement for developers
> on this day and age.

I don't know about codepages, but a lot of stuff I've worked on ---
Windows, various mobile devices, Java --- speak UTF-16 almost
exclusively. Well, when they don't get it wrong and speak UCS-2 instead,
with Hilarious Results if anyone tries to use non-BMP code points.

What, bitter? Me?

> and, of course the easiest (and most flexible) solution is to still
> accept only UTF-8 but providing a handy cp2utf8() conversion function.
>  preferably on a separate package.

iconv is your friend, here; it's got a very easy-to-use API, and there's
a front end command that makes it trivial to write Very Small Shell
Scripts that wrap your program and preprocess the input. See:

	http://luaforge.net/projects/lua-iconv/

Or even a Very Small Shell Script that runs the input through iconv.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup

Attachment: signature.asc
Description: OpenPGP digital signature