On Sat, 17 Dec 2011, Berend Hasselman wrote:
On 16-12-2011, at 23:48, Allin Cottrell wrote:
> Hello all,
>
> We have a problem with internationalization of gretl's TeX output
> (mostly on Windows) and I'd like to ask for your views.
>
> The current situation is as described in chapter 32 of the Gretl
> User's Guide. That is:
>
> (a) If the "system" encoding is UTF-8 we output TeX in UTF-8 and put
> appropriate \usepackage{} lines into the TeX header. That's OK.
>
> (b) Otherwise we output TeX in the locale encoding and put
> \usepackage[latin1]{inputenc} into the header. That might have been
> OK in the days when the only translations of gretl were into West
> European languages, but it's not OK any more.
>
> My proposed fix is that we always output TeX in UTF-8, regardless of
> the platform and the system text encoding. This means that when we
> output "complete" TeX files (with a header) they will include:
>
> \usepackage{ucs}
> \usepackage[utf8x]{inputenc}
>
> Does anyone see a problem with this? Or have an alternative
> solution?
An alternative solution could be to use a template file.
The template would contain the fixed preamble such as
\documentclass[11pt]{article}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
(Note: generated on Mac OS X).
A user can change the template to fit their needs. [...]
In effect we already do that: the manual explains that the user can
put in place a file "gretlpre.tex" that replaces the default TeX
preamble. But my main question is, what encoding should gretl use
when emitting TeX on non-English systems where the "system" encoding
is not UTF-8?
The case that sparked this is gretl running in Turkish on Windows.
The "system" encoding is Microsoft CP1254. If gretl writes out TeX
in CP1254 (as it does at present), it's not going to work if the
user has a custom preamble that calls inputenc with the utf8 option.
The inputenc option has to match the actual text.
Allin