[tex-live] Unicode filename problem

Manuel Pégourié-Gonnard mpg at elzevir.fr
Sat Nov 1 23:52:50 CET 2008


Torsten Ekedahl a écrit :
> I've just switched from iso-latin-1 to UTF-8 on my computer. This has revealed 
> a problem with tex.
> 
Not really with TeX, I think. Probably more with LaTeX's inputenc and/or
something in your system. (So the texhax list may be more appropriate.)

> homealone[1]cat test.tex
> \input inlämning.tex

Is test.tex encoded in utf-8? And the filename too? Because in this case
it should work (it does work for me btw).

> homalone[1]latex test.tex
> This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
>  %&-line parsing enabled.
> entering extended mode
> (./retex.tex

Why is your latex inputing retex.tex??? Is it really compiling the
one-line file shown above? If so, there is something very strange with
your latex format. (Maybe you \dump'ed something as latex.fmt by mistake.)

>                    \unhbox
> l.8 \input inlä
>                 mning.tex
> 
This is a problem with LaTeX's inputenc (and btw it shows you didn't
load fontenc with T1, which is higly recommended for german.

> This is probably not too surprising (and I wasn't) but it is not clear to me 
> that this is the way God intended it to be. However, it becomes more 
> surprising if one tries to dump a format:
> 
I have no idea about what this god guy intented, but one could try the
following.

\documentclass{minimal}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\makeatletter
\newcommand\safeinput[1]{%
  \begingroup
  \count at 128
  \@whilenum \count@<\@cclvi \do{%
    \uccode`\~\count@
    \uccode`\+\count@
    \uppercase{\let~+}%
    \advance\count@\@ne}
  \expandafter\endgroup
  \@@input "#1" }
% ...
\safeinput{inlämning}

> character format plays havoc with the file name. However, I wanted to bring 
> it to everyone's attention but wouldn't be too upset with a "don't do that 
> then" kind of answer.
> 
My technical answer is above, now here is my advice: do *not* use
non-ascii characters in filenames anyway.

Manuel.


More information about the tex-live mailing list