[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: character encoding question
From: Richard =?iso-8859-1?q?L=E4rk=E4ng?= <nouseforaname () home ! se>
Date: 2004-10-24 14:40:10
Message-ID: 200410241640.11017.nouseforaname () home ! se
[Download RAW message or body]
On Sunday 24 October 2004 16.22, Rolf Magnus wrote:
> On Saturday 23 October 2004 21:48, Jason Harris wrote:
> > Hello,
> >
> > I need to add three Swedish cities to KStars (see:
> > http://bugs.kde.org/show_bug.cgi?id=83125).
> >
> > However, two of the city names contain non-ascii characters, and when I
> > paste their names into the Cities.dat file, they are not being encoded
> > properly. What I mean is, other non-ascii characters in the file
> > appear as one or more "garbage" characters, but are rendered correctly
> > in KStars. When I add these new cities, the non-ascii characters are
> > rendered correctly in the Cities.dat file, but are not rendered at all
> > in KStars. I hope that makes sense.
> >
> > Anyway, I have no idea how to encode these non-ascii characters
> > correctly in the Cities.dat file. Can anyone give me a clue?
>
> Set your editor to utf-8.
And you should also apply this patch I think, otherwise it will be loaded as
latin1.
Richard Lärkäng
["utf8-fix.patch" (text/x-diff)]
Index: ksfilereader.cpp
===================================================================
RCS file: /home/kde/kdeedu/kstars/kstars/ksfilereader.cpp,v
retrieving revision 1.3
diff -u -p -b -B -r1.3 ksfilereader.cpp
--- ksfilereader.cpp 9 Apr 2004 20:32:56 -0000 1.3
+++ ksfilereader.cpp 24 Oct 2004 14:38:29 -0000
@@ -22,7 +22,7 @@
KSFileReader::KSFileReader(QFile& file) {
// read the whole file at once. This works well at least for the smaller files.
- QString sAll( file.readAll() );
+ QString sAll( QString::fromUtf8(file.readAll()) );
// split into list of lines
lines = QStringList::split( "\n", sAll );
// how many lines did we get?
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic