[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kopete-devel
Subject:    Re: [Kopete-devel] [Bug 72917] UTF8 and other cause XML parsing
From:       Martijn Klingens <klingens () kde ! org>
Date:       2004-01-23 20:25:54
Message-ID: 200401232125.54118.klingens () kde ! org
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic