Summary: | switching to kjots 0.7 deleted all umlauts and directly following letters from books and pages | ||
---|---|---|---|
Product: | [Unmaintained] kjots | Reporter: | Janet <bugzilla> |
Component: | general | Assignee: | Jaison Lee <lee.jaison> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 0.7 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Janet
2006-03-01 01:31:32 UTC
I see what you mean, but strangely the problem doesn't seem to happen during the conversion; everything looks fine at first, but after the page is redisplayed it stops showing characters with diacritics correctly. It looks like it is just a display problem, as all the data remains in tact in the file. So long as you haven't done anything to alter the file data, all the data is stored in the .book file just fine. A temporary workaround to get up and running on the new version would be to open the .book with kedit or something, copy the data out, then open up KJots and turn on Unicode and paste the data back in. If you have already done something to alter the data and cause a save then it may not save correctly. That happened once while I was playing around just now. (I'm not sure precisely what I did to cause it, usully the data is just fine.) The above method should work for getting the data back into the old version as well. I'm sorry but the file formats between the KJots in KDE3.4 and KDE3.5 are simply not cross-compatible. You will need to pick one version or the other to use. I'm sorry you had problems, but the initial time the data is displayed it looks OK, which is undoubtably why this problem persisted. Only after redisplaying the data does the encoding problem become visually apparent. I'm sure this is just an encoding issue somewhere, I just can't figure out where just now. :( Luckily I have a current backup of my kjots 0.6 books so I can copypaste all pages into kjots 0.7. That's easier than using the converted bookfiles to do it. And as I have seen just now the converted bookfiles now also miss the mentioned characters. Maybe because I tried to save. Would have been nice to have been warned on the first run of the new version that the program is now going to convert the books to another format and that it might be wise to update the old books first. Do you plan to keep this format or will there be another change with KDE 4? Well - and even if it might not look like it: I appreciate the work you have done with kjots :) >Do you plan to keep this format or will there be another change with KDE 4?
The new XML format will give KJots all the growth it needs forever. There will definately be new elements added as the feature list grows, but I can't imagine needing to change to something other than XML.
SVN commit 515542 by jlee: BUG:122876 Encoding is not being stored correctly in the XML. For now, use a QTextStream to read it in properly. M +5 -1 kjotsentry.cpp --- branches/KDE/3.5/kdeutils/kjots/kjotsentry.cpp #515541:515542 @@ -306,8 +306,12 @@ if ( file.exists() && file.open(IO_ReadWrite) ) //TODO: Implement read-only mode? { + QTextStream st(static_cast<QIODevice*>(&file)); + st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale ); + QString data = st.read(); + QDomDocument doc( "KJots" ); - if ( doc.setContent( &file ) ) + if ( doc.setContent( data ) ) { QDomElement docElem = doc.documentElement(); |