LyXProblem opening .lyx file

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
DavidM
Posts: 20
Joined: Wed Jul 01, 2009 9:52 pm

Problem opening .lyx file

Post by DavidM »

Hi everyone,

I am using Lyx 1.6.7. I saved an important .lyx file on my memory stick, and I cannot open it in Lyx anymore. I get the following error information:

Code: Select all

Error returned from iconv
EINVAL An incomplete multibyte sequence has been encountered in the input.
When converting from UTF-8 to UCS-4LE.
Input: 0x61 0x64 0x62 0x64 0xcb
Error returned from iconv
EILSEQ An invalid multibyte sequence has been encountered in the input.
When converting from UTF-8 to UCS-4LE.
Input: 0xca 0x42 0x65 0x63 0x60 0x68 0x4f 0x6c
Completed
I can open the file in notepad and see my text. Now I could copy the text into a new lyx file and redo the many formulas. But given the amount of formulas in the document, I would like to open it in lyx.

This file is a child document in another document. The 'mother' file has the same error. Perhaps this has something to do with it.

Does anyone know how to recover the file?

Regards,
David

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Problem opening .lyx file

Post by meho_r »

For starters, make sure that you don't have and non-ascii characters in the path to the .lyx file (as well as in the name of the .lyx file itself). Characters like ê, à, č, đ etc. in the path often cause problems, and not only with LyX.

If this isn't the problem, try using LyX 1.6.8 to open the file.
DavidM
Posts: 20
Joined: Wed Jul 01, 2009 9:52 pm

Problem opening .lyx file

Post by DavidM »

Thanks for your reply!

I found out the problem. Lyx made an error while writing the file away last time, and forgot to put

Code: Select all

\end_body
\end_document
at the end of the document, so LyX just kept on going. It also deleted some of my text. Luckily a .lyx~ file with the complete correct code was also in the folder, so I copied this code to the .lyx file and all is well now :D What is that .lyx~ anyway?
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Problem opening .lyx file

Post by meho_r »

.lyx~ is a backup file which is produced by default automatically every 5 minutes and when saving your file (Tools > Preference > User Interface > Documents). These files are invisible on Linux, but I'm not sure about Windows.
DavidM
Posts: 20
Joined: Wed Jul 01, 2009 9:52 pm

Re: Problem opening .lyx file

Post by DavidM »

Thanks! Wish I had known this before I despaired of recovering my document.

Yes, .lyx~ is visible in windows.
Post Reply