[luatex] Localisation of Lua or LuaTeX

luigi scarso luigi.scarso at gmail.com
Fri Mar 2 10:07:11 CET 2012

On Fri, Mar 2, 2012 at 9:12 AM, Ralf Meyer <rameyer at uni-math.gwdg.de> wrote:

> Dear Luigi,
> it was as you expected: on my system,
> os.setlocale("de_DE.utf8")
> has the required effect, thanks.
> It is remarkable that the names of locales are so system dependent.
> Even more disturbing, the shell command "locale -a" showed me that my
> computer only knows about several German and English locales.
> Hence a french luatex document a colleague sends me will not work on my
> computer because it lacks the necessary locales, and probably my
> documents will not work on his computer for the same reason.  This is
> really bad news!  One of the great things about TeX is portability.
> Should one refrain from using the os library, or at least its
> localisation aspects, and warn users to avoid it for this reason?
> Should one reimplement the localisation libraries that os.setlocale is
> calling in luatex itself, so that users can rely on a common framework
> all over the world?
Every os.* is, of course, os dependant. I have a linux box that has 19
locales, another one that has 731..Of course
Windows and MacOS have their locale setup too.

It's a matter of robust programming then: for simple things for example
maybe this is ok
if os.setlocale("<your string>") == nil then
 if os.setlocale("<another try 1>") == nil then
  if os.setlocale("<another try 2>") == nil then
but locale is a huge .. and you reinvent the wheel.
A common framework is icu : just jump to
and see how much complex localization+encoding can be.

About portability: even with tex (I mean the Knuth tex, not etex or pdftex
or luatex) the same source can
give very different results if you use only a slightly different version of
the same metafont font (given that we use the same frozen  tex version, of
course). So the same result is a matter of the same boundary conditions.
Things doen't change much with luatex, we have more  boundary conditions
than before --- but with lua we  have much more power than before and hence
we need more control.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20120302/84858e05/attachment.html>

More information about the luatex mailing list