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?

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:

Interestingly enough the Qt docs says that Big endian is the order prescribed by the Unicode Standard in the absence of higher-level protocols. Here is the full text:


System Support

Some of the operating systems and windowing systems that Qt runs on only have limited support for Unicode. The level of support available in the underlying system has some influence on the support that Qt can provide on those platforms, although in general Qt applications need not be too concerned with platform-specific limitations.

Unix/X11

Locale-oriented fonts and input methods. Qt hides these and provides Unicode input and output. Filesystem conventions such as UTF-8 are under development in some Unix variants. All Qt file functions allow Unicode, but convert filenames to the local 8-bit encoding, as this is the Unix convention (see QFile::setEncodingFunction() to explore alternative encodings).
File I/O defaults to the local 8-bit encoding, with Unicode options in
QTextStream.

Windows

Qt provides full Unicode support, including input methods, fonts, clipboard, drag-and-drop and file names. File I/O defaults to Latin1, with Unicode options in QTextStream. Note that some Windows programs do not understand big-endian Unicode text files even though that is the order prescribed by the Unicode Standard in the absence of higher-level protocols. Unlike programs written with MFC or plain winlib, Qt programs are portable between Windows 98 and Windows NT. You do not need different binaries to support Unicode.

Reply via email to