On Tue, Mar 07, 2017 at 12:06:12AM +0000, José Abílio Matos wrote:
> On Monday, 6 March 2017 22.27.25 WET Enrico Forestieri wrote:
> > The problem is that the file starts with a U+FEFF BOM mark, and most
> > probably lyx2lyx doesn't expect to deal with BOM marks. Actually, the
> > conversion succeeds, but the BOM mark is left in place (it now appears
> > on the second line, though). Consequently, lyx then chokes on reading it.
> > It suffices removing the bogus second line of the converted file to make
> > it perfectly readable by lyx 2.2.
> > LyX 2.1 is able to read it because no conversion is necessary and the BOM
> > mark is skipped because it is dealt with by the lexer when it is at the
> > beginning of the file.
> 
> Thank you for noticing that. :-)
> 
> The next question is how it got there. I assume of course that somewhere 
> windows was involved. :-)

Maybe :-)

> Is this a valid process that we should support?

Given that lyx2lyx processes text files, taking into account that they
may have a BOM is safer.

> If so the following patch fixes this for me, for both python 2 and 3.

I think you can safely commit it.

-- 
Enrico

Reply via email to