From kopete-devel Fri Jan 23 20:25:54 2004 From: Martijn Klingens Date: Fri, 23 Jan 2004 20:25:54 +0000 To: kopete-devel Subject: Re: [Kopete-devel] [Bug 72917] UTF8 and other cause XML parsing Message-Id: <200401232125.54118.klingens () kde ! org> X-MARC-Message: https://marc.info/?l=kopete-devel&m=107488956418546 On Friday 23 January 2004 21:13, Jason Keirstead wrote: > isUTF8() is fine for checking, but it's useless for taking a string and > making it displayable in unicode even if it isn't. That's why you don't even USE ::fromUtf8 if isUtf8() returns false ;) > I had assumed that QChar took care of the doubel byte stuff for me. It does... if you feed it the double bytes :) If you feed it byte by byte it will inevitably fail, because the second byte of a double byte sequence is still valid more often than not. And you cannot assume that if the first byte fails that you should strip the 2nd byte, because there are also characters that need 3 or more bytes. > If it doesn't then I don't know how we can do this. See Thiago's code :) > UTF-8 should be last, because latin1 will indicate failure if it's not > latin1. UTF is the only codec in QT that *always* decodes. So we shoudl try > that last, then clean it up. Thiago claimed that Latin also allows everything. I don't understand why though, and it would suck, but those are different issues... -- Martijn _______________________________________________ Kopete-devel mailing list Kopete-devel@kde.org https://mail.kde.org/mailman/listinfo/kopete-devel