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

List:       koffice-devel
Subject:    Re: KoXmlWriter and UTF-8
From:       David Faure <faure () kde ! org>
Date:       2005-09-09 3:20:01
Message-ID: 200509090520.01883.faure () kde ! org
[Download RAW message or body]

On Tuesday 06 September 2005 10:43, Ariya Hidayat wrote:
> 
> I notice that in KoXmlWriter, addTextSpan() calls addTextNode() without 
> converting the string to UTF-8. This implies that we can't create a text span 
> which contains unicode characters > 255 correctly.
> Possible solution is to do utf8 conversion first (which is expensive), 
> but then the escaping (escapeForXML) might not work properly.
> 
> Perhaps I'm missing something here?

You might be right that the escaping might be broken in some cases,
but I think you're missing the fact that addTextNode(QString) is inline
and converts to utf8 before calling addTextNode(const char*).

I added a non-ascii character to store/tests/xmlwritertest.cpp and it seems
to work for me; does the test work for you?

For the escaping, I'm not sure how to fix it without duplicating the escaping code
for char and QChar, or adding more conversions (which the API aims at avoiding)...

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel

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

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