[luatex] Localisation of Lua or LuaTeX

Reinhard Kotucha reinhard.kotucha at web.de
Fri Mar 2 02:20:22 CET 2012


On 2012-03-01 at 22:28:30 +0100, Philipp Stephani wrote:

 > > What could be the reason for os.setlocale to have no effect?
 > 
 > Windows uses different names (e.g, "German"), but your mail headers
 > tell me you're running Linux, so that should work.  My best guess
 > is that the localization package is not installed.

Maybe a bit unrelated: I'm executing an external program from texlua
and want to tell it to emit its output in UTF-8.

On Linux I set the locale with os.setenv() before running
os.execute().  This works fine because on Linux it's sufficient to set
an environment variable.  I don't know how to achieve this on
Windows.  It's probably not sufficient to set an environment
variable.  Does os.setlocale() has an effect on external programs or
does it affect Lua functions only?  I could't try because I don't hnow
which argument is expected on Windows.

What I'm doing now is to check with os.type whether the program is run
under Windows and if so, I use the tiny functions recently published
by Paul Isambert in TUGboat in order to convert strings from
ISO-8859-1 to UTF-8.  The only non-ASCII characters I currently have
to deal with are µ and ½, hence this workaround is sufficient.

It would be nicer though if I could ask the external program to emit
UTF-8 on Windows too.  Any idea how to accomplish it?

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------



More information about the luatex mailing list