When I want to export a document containing a non-latin 1 letter I get this 
lyx2lyx error:

Traceback (most recent call last):
  File "C:/Program Files (x86)/LyX 1.5beta2-21-04-2007/Resources/lyx2lyx/lyx2lyx
", line 101, in <module>
    sys.exit(main(sys.argv))
  File "C:/Program Files (x86)/LyX 1.5beta2-21-04-2007/Resources/lyx2lyx/lyx2lyx
", line 95, in main
    file.write()
  File "C:\Program Files (x86)\LyX 1.5beta2-21-04-2007\Resources\lyx2lyx\LyX.py"
, line 275, in write
    self.output.write(line.encode(self.encoding)+"\n")
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u0301' in position
 0: ordinal not in range(256)
Error: Cannot convert file

Attached iy my LyX-tesfile. The character u0301 is in this word in my file

"hornjoserbšćina"

So the why is the encoding latin1 used here and not unicode?.
I can compile the file because LyX uses this correct code for the word in LaTeX:

hornjoserbš\'{c}ina

The lyx2lyx procedure I call testwise when I get this error is simply

def revert_dummytest(document):
    i = 0

So the called procedure does nothing, but I get an encoding error.

---

When my document contains for example an Armenian character I get this error 
message insted:

  File "C:\Program Files (x86)\LyX 1.5beta2-21-04-2007\Resources\lyx2lyx\LyX.py"
, line 275, in write
    self.output.write(line.encode(self.encoding)+"\n")
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 1-3: ord
inal not in range(256)
Error: Cannot convert file

In this case I also only call the dummy procedure I get this error:

Traceback (most recent call last):
  File "C:/Program Files (x86)/LyX 1.5beta2-21-04-2007/Resources/lyx2lyx/lyx2lyx
", line 101, in <module>
    sys.exit(main(sys.argv))
  File "C:/Program Files (x86)/LyX 1.5beta2-21-04-2007/Resources/lyx2lyx/lyx2lyx
", line 94, in main
    file.convert()
  File "C:\Program Files (x86)\LyX 1.5beta2-21-04-2007\Resources\lyx2lyx\LyX.py"
, line 412, in convert
    conv(self)
  File "C:\Program Files (x86)\LyX 1.5beta2-21-04-2007\Resources\lyx2lyx\lyx_1_5
.py", line 1027, in revert_accent
    encoding_stack = [get_encoding(document.language, document.inputencoding, 24
8, document.cjk_encoding)]
  File "C:\Program Files (x86)\LyX 1.5beta2-21-04-2007\Resources\lyx2lyx\LyX.py"
, line 125, in get_encoding
    return lang[language][3]
KeyError: 'armenian'
Error: Cannot convert file

This occurs also when none of the lyx2lyx files contain the word "armenian" and I use the encoding settings of my Armenian patch in this case.
Attached is a LyX-testfile containing an armenian character.
Do I need in this case to load a special Python file that can understand the 
armscii8-encoding?

How can this be fixed?

thanks and regards
Uwe

Attachment: arm.lyx
Description: application/lyx

Attachment: sorb.lyx
Description: application/lyx

Reply via email to