Georg Baum wrote:
Am Donnerstag, 24. August 2006 18:47 schrieb Abdelrazak Younes:
Enrico Forestieri wrote:
I have compiled a Cygwin version of LyX/Qt4 using the native GUI (no
X11)
and now I see the chinese characters mentioned by Abdel when I load
an old document. I also get a lot of messages on the console:

Error returned from iconv
EILSEQ An invalid multibyte sequence has been encountered in the input.
When converting from UCS-4 to UCS-2.
Input: 0xff 0xff 0xff 0xa2
This was not the case with Qt3 where the characters were simply hollow
squares on screen. However, when I start a new document the characters
are shown correctly.
The attached patch at least make LyX show normal text correctly.

Abdel,

do you still need that patch?

No, not since I have done my own hand-made conversion in qt_helpers.


There is something with the byte order I don't understand. I just found out that with the iconv on my little endian linux box UCS-4 == UCS-4BE. That means that the bytes coming from iconv are in big endian byte order. This is reversed in bytes_to_ucs4:

[...]

If you still need the patch then I don't understand what happens.

I don't need it.

Furthermore the byte order change does not happen in bytes_to_ucs2.

We don't use that anymore for the qt4 frontend.


I believe that the attached patch should make the unicode conversions work on little and big endian machines, and removes the uncertainty whether UCS-4 is LE or BE.

Using UCS4-INTERNAL and memmove() the result as suggested by Angus would be even better, but it seems that it is not available on windows.

How do you know?


Comments and tests on windows and Mac PPC are welcome.

I'll try... But quite frankly I'd rather get rid of the iconv dependency. Especially since your patch distinguish between BE and LE. The code is available elsewhere so why not just do our own utf8 to/from ucs4 adapted to docstring and be done with it. That seems the only sane approach.

Abdel.

Reply via email to