>> So, does this completely fix this? Or is there still work to be done
>> with the inputenc stuff?
>
> I guess there's a lot left. But I'll approach that on a case-by-case
> base. Better get known cases right instead of being stuck for years
> while waiting for perfect solutions to appear magically...

"magic" does not help in general as we will still stay sticked where we are. We need a general solution to be able to create a lyxformat newer than 248. I attached a LyX file and its TeX output. This one compiles fine with latex and pdflatex. The exercise we have is to import this TeX file to get the same as in the LyX file. (I already implemented tex2lyx support for the language handling, like \selectlanguage. What is missing is the handling of the encoding.)

I prefer that we agree to a basic concept how to fix this. I proposed one that will work in all cases, but I don't know if iconv can handle that. What I wanted to point out in my last comments is that a TeX file is in general a multi-encoding document. The encoding of the different document parts are given by the options of inputenc and \inputencoding, see so the attached TeX file.

So my proposal is to read the encodings from the TeX file and convert the document parts via iconv to uft8 and build then the LyX file.

regards Uwe
%% LyX 1.6.0svn created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[greek,ukrainian,basque]{article}
\usepackage[T1]{fontenc}
\usepackage[iso-8859-7,koi8-u,latin9]{inputenc}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\DeclareRobustCommand{\greektext}{%
  \fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}

\DeclareRobustCommand{\cyrtext}{%
  \fontencoding{T2A}\selectfont\def\encodingdefault{T2A}}
\DeclareRobustCommand{\textcyr}[1]{\leavevmode{\cyrtext #1}}
\AtBeginDocument{\DeclareFontEncoding{T2A}{}{}}


\usepackage{babel}

\begin{document}
bla

\selectlanguage{ukrainian}%
\inputencoding{koi8-u}%
ËÉÒÉÌÉÃÅÀ

\selectlanguage{basque}%
\inputencoding{latin9}bla 
\inputencoding{koi8-u}\foreignlanguage{ukrainian}{ËÉÒÉÌÉÃÅÀ}\inputencoding{latin9}
bla

bla

\selectlanguage{greek}%
\inputencoding{iso-8859-7}%
svõããíþìç

\selectlanguage{basque}%
\inputencoding{latin9}bla 
\inputencoding{iso-8859-7}\foreignlanguage{greek}{svõããíþìç}\inputencoding{latin9}
bla
\end{document}

Attachment: newfile1.lyx
Description: application/lyx

Reply via email to