lua-users home
lua-l archive

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

Hash: SHA1

On 27/02/10 18:21, Sam Roberts wrote:
> Then only windows would have to special, unless you have less there,
> you might have
> to use more.

Windows is extremely special, and its terminal basically doesn't do

It *is* possible to persuade the console to accept UTF-8, but you have
to use special Windows-specific calls to output data rather than just
doing printf(); and the standard bitmap fonts don't do font substitution
anyway so you're still limited to the ANSI character set (anything else
just shows up as ?). You *can* do a nasty registry hack to force the
console to use a real font, but it's still highly unsatisfactory.

You can see the code I did for WordGrinder here:

It is all C, alas. Also, here:

...are simple C routines (and Lua bindings thereof) for reading and
writing UTF-8 strings.

(My eventual solution to this mess was to write my own custom console
using raw GDI calls. It turns out to be about 2000 lines of code. The
WordGrinder source itself is only 6000...)

- -- 
┌─── ───── ─────
│ 𝕻𝖍'𝖓𝖌𝖑𝖚𝖎 𝖒𝖌𝖑𝖜'𝖓𝖆𝖋𝖍 𝕮𝖙𝖍𝖚𝖑𝖍𝖚
│ 𝕽'𝖑𝖞𝖊𝖍 𝖜𝖌𝖆𝖍'𝖓𝖆𝖌𝖑 𝖋𝖍𝖙𝖆𝖌𝖓.
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -