Version: SVN revision 581239 (using KDE KDE 3.5.4) Installed from: Compiled From Sources Compiler: gcc (GCC) 4.1.1 (Gentoo 4.1.1) OS: Linux Undo and redo will turn non ascii tags into ??? See patch for more info.
Created attachment 17645 [details] small fix The playlist history xml file would not get saved correctly without this.
SVN commit 581392 by seb: Write xml files with utf8, else we would get junk BUG: 133613 M +1 -1 metabundle.cpp --- trunk/extragear/multimedia/amarok/src/metabundle.cpp #581391:581392 @@ -1442,7 +1442,7 @@ { QDomElement tag = QDomSucksItNeedsADocument.createElement( exactColumnName( i ) ); //debug() << "exactColumName(i) = " << exactColumnName( i ) << endl; - QDomText text = QDomSucksItNeedsADocument.createTextNode( exactText( i, true ) ); + QDomText text = QDomSucksItNeedsADocument.createTextNode( exactText( i, true ).utf8() ); //debug() << "exactText(i) = " << exactText( i ) << endl; tag.appendChild( text );
i blame this change for the problem that has surfaced recently :) opening playlist that was saved with diacritic symbols in it now displays garbage. and with each restart of amarok the borked string increases in length, as if saving it was done in utf8, but opening was not.
SVN commit 581762 by markey: Reverting commit 581392. It's causing playlast borkage for some folks. CCBUG: 133613 M +1 -1 metabundle.cpp --- trunk/extragear/multimedia/amarok/src/metabundle.cpp #581761:581762 @@ -1442,7 +1442,7 @@ { QDomElement tag = QDomSucksItNeedsADocument.createElement( exactColumnName( i ) ); //debug() << "exactColumName(i) = " << exactColumnName( i ) << endl; - QDomText text = QDomSucksItNeedsADocument.createTextNode( exactText( i, true ).utf8() ); + QDomText text = QDomSucksItNeedsADocument.createTextNode( exactText( i, true ) ); //debug() << "exactText(i) = " << exactText( i ) << endl; tag.appendChild( text );
*** Bug 133793 has been marked as a duplicate of this bug. ***
since the fix was reverted, this bug is still valid.
SVN commit 582700 by aoliveira: Another attempt to fix the encoding problems when saving current playlist. BUG: 133613 M +2 -2 metabundle.cpp --- trunk/extragear/multimedia/amarok/src/metabundle.cpp #582699:582700 @@ -1448,8 +1448,8 @@ item.appendChild( tag ); } - - item.save( stream, indent ); + QDomSucksItNeedsADocument.appendChild( item ); + stream << QDomSucksItNeedsADocument.toCString(); return true; }
*** Bug 133798 has been marked as a duplicate of this bug. ***
revision 582974. the problem is here again, playlist entries with diacritic symbols grow in size upon each close/open iteration. i can provide before/after, if that could help in any way.
*** Bug 133761 has been marked as a duplicate of this bug. ***
*** Bug 133970 has been marked as a duplicate of this bug. ***
Rich, which enconding do you use (UTF8, I would guess)? Can you send me one of these files?
SVN commit 583729 by markey: Revert Alex's encoding fix attempt. I don't think is needed any more, as the real problem was in Playlist::saveXML(). CCBUG: 133613 M +6 -6 metabundle.cpp --- trunk/extragear/multimedia/amarok/src/metabundle.cpp #583728:583729 @@ -1428,8 +1428,8 @@ bool MetaBundle::save( QTextStream &stream, const QStringList &attributes ) const { - QDomDocument qDomSucksItNeedsADocumentAndDoesntUseUnicodeWhenItShould; - QDomElement item = qDomSucksItNeedsADocumentAndDoesntUseUnicodeWhenItShould.createElement( "item" ); + QDomDocument qDomSucksItNeedsADocument; + QDomElement item = qDomSucksItNeedsADocument.createElement( "item" ); item.setAttribute( "url", url().url() ); item.setAttribute( "uniqueid", uniqueId() ); if( m_isCompilation ) @@ -1440,16 +1440,16 @@ for( int i = 0; i < NUM_COLUMNS; ++i ) { - QDomElement tag = qDomSucksItNeedsADocumentAndDoesntUseUnicodeWhenItShould.createElement( exactColumnName( i ) ); + QDomElement tag = qDomSucksItNeedsADocument.createElement( exactColumnName( i ) ); //debug() << "exactColumName(i) = " << exactColumnName( i ) << endl; - QDomText text = qDomSucksItNeedsADocumentAndDoesntUseUnicodeWhenItShould.createTextNode( exactText( i, true ) ); + QDomText text = qDomSucksItNeedsADocument.createTextNode( exactText( i, true ) ); //debug() << "exactText(i) = " << exactText( i ) << endl; tag.appendChild( text ); item.appendChild( tag ); } - qDomSucksItNeedsADocumentAndDoesntUseUnicodeWhenItShould.appendChild( item ); - stream << qDomSucksItNeedsADocumentAndDoesntUseUnicodeWhenItShould.toCString(); + + item.save( stream, 1 ); return true; }
alexandre, do you still need the file ? if so, is it current.xml or one of music files containing diacritic chars ?
*** Bug 133996 has been marked as a duplicate of this bug. ***
fix confirmed in revision 583736
Can anyone else please confirm whether the playlist /encoding/ problem is fixed in SVN trunk? I would like to be sure before creating a patch.
Yes, it works fine now.
Seems fine here
*** Bug 134076 has been marked as a duplicate of this bug. ***
amarok version: 1.4.3 compiler: gcc (GCC) 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0) distribution: Mandriva Linux 2006.0 I am not so sure that this problem is fixed. I just encountered the same issue: amarok: [PlaylistLoader] [ERROR!] [PLAYLISTLOADER]: Error in \ ///home/ehovland/.kde/share/apps/amarok/current.xml: Error \ loading XML: "tag mismatch", at line 7970, column 8. The file has this at that line: <item url="file:///export/home/music/ogg/Beastie_Boys/Check_Your_Head/20_Namast%E9.ogg" uniqueid="5f8759b3cfc979a6acb753f0abae3eb5" > I changed the tag to remove the e with the accent over it and it loads fine now. So the issue is with the parsing of the special character.
Good morning, Erik. We've been talking about SVN TRUNK, instead you haven't noticed.
For the sake of bookkeeping, here is the commit that actually fixed this bug (I had forgotten to CC this report back then): SVN commit 583706 by markey: Try to fix the playlist encoding problem which was probably a regression of my saveXML performance tweaks. M +1 -0 playlist.cpp --- trunk/extragear/multimedia/amarok/src/playlist.cpp #583705:583706 @@ -3188,6 +3188,7 @@ stream << "</playlist>\n"; QTextStream fstream( &file ); + fstream.setEncoding( QTextStream::UnicodeUTF8 ); fstream << buffer; }
Thanks for the completeness post, I have this fix backported into my 1.4.3 tree and I will give it a try.
Hello, I'm using amarok 1.4.3-5 for mandriva which includes this latest patch, and for me the problem is still there, I can't load the playlists that were saved with Amarok 1.4.2. These playlists contain some latin1 character and this seems to break the xml parser when trying to restore the file. Apart from that, creating new playlist is OK, chars are saved as utf8 and reloading is OK, so the regression is when trying to use playlists from amarok 1.4.2. (you can see http://qa.mandriva.com/show_bug.cgi?id=25493 for more details)