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

List:       kde-core-devel
Subject:    Re: [PATCH]: KNewsTicker querying non-ISO8859-1 sites
From:       Frerich Raabe <raabe () kde ! org>
Date:       2002-03-09 15:47:36
[Download RAW message or body]

On Friday 08 March 2002 13:45, Lars Knoll wrote:
> > the attached patch, courtesy of Volker Augustin
> > <volker.augustin@perfektionismus.de> apparently makes cyrillic characters
> > as well as german umlauts work in KNewsTicker. I hope it makes asian
> > charsets work as well, but I didn't yet find a suitable font.
> >
> > You can use the URLs http://www.slashdot.jp/slashdot.rdf (japanese),
> > http://www.hamovniki.net/~d00mer/lenta_rdf/lenta.rdf (russian) and
> > http://www.heise.de/newsticker/heise.rdf (german) to test. Just in case
> > somebody has one of those giant unicode fonts handy.
>
> The patch is way to complicated and disregards that QXml can do the
> decoding work for you. QXml can autodetect the encoding, if you don't use
> the QDomDocument::setContent( Q(C)String ) method, but setContent(
> QByteArray ).
>
> Please try the one liner attached. Seems to work fine for me for the
> russian page.

It seems as if the setContent(QByteArray) version does more than checking the 
encoding. If I use that patch, certain newsfeeds can't be properly processed 
at all (setContent returns false). Using the QCString version works for much 
more newsfeeds. I tested this with 'KDE Dot News' (works only with QCString), 
'Slashdot' (work with neither QCString or QByteArray, for whatever reasons. 
The download itself succeeded though, guess I'll have a look at the 
downloaded markup), 'Linux Weekly News' (only newsfeed of the four which 
works with QByteArray) and 'Kuro5hin' (works only with QCString).

Perhaps that setContent() method does some stricter checking? Or does it barf 
without any justified reason?

- Frerich

>
> Lars

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

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