Bug 122395

Summary: charset trouble in konqueror sidebar with latin locales
Product: [Applications] amarok Reporter: Adeodato Simó <dato>
Component: generalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: ana, kdebugs
Priority: NOR    
Version: 1.4-SVN   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Adeodato Simó 2006-02-21 03:56:24 UTC
Hi, this comes from Debian Bug#353058 (http://bugs.debian.org/353058) 
submitted by Grégoire Druant <g.druant@gmail.com>. It was reported against 
amaroK 1.3.8, but I've verified it happens in 1.4-beta1+r511476.

The description of the problem is simple: in latin locales (i.e., `locale 
charmap` returns ISO-8859-1 or similar), while accented characters are 
displayed properly in the Context tab, they're wrong ("utf8ized") in the 
konqueror sidebar. Check this screenshot:

http://people.debian.org/~adeodato/tmp/2006-02-21/amarok-sidebar1.png

In UTF-8 locales (i.e., `locale charmap` returns UTF-8), this is not 
reproducible.

Thanks.
Comment 1 Mark Kretschmann 2006-02-21 08:00:37 UTC
*** Bug 115740 has been marked as a duplicate of this bug. ***
Comment 2 Alexandre Oliveira 2006-02-21 19:02:28 UTC
SVN commit 512063 by aoliveira:

Konqueror sidebar would show garbage for people not using UTF-8 locales.
BUG: 122395


 M  +7 -6      universalamarok.cpp  


--- trunk/extragear/multimedia/amarok/src/konquisidebar/universalamarok.cpp #512062:512063
@@ -97,7 +97,7 @@
     browser->view()->installEventFilter( widget );
     amarokDCOP = new DCOPClient();
     amarokDCOP->attach();
-    
+
     playerStub   = new AmarokPlayerInterface_stub( amarokDCOP, "amarok", "player");
     playlistStub = new AmarokPlaylistInterface_stub( amarokDCOP, "amarok", "playlist");
 
@@ -112,21 +112,21 @@
 
     toolBar->insertSeparator();
     toolBar->insertButton( "arts",        0, SIGNAL( clicked() ), this, SLOT( sendMute() ) );
-    
+
     vol_slider = new QSlider(0,100,1,0,Qt::Horizontal, toolBar,"volume");
     vol_slider->setLineStep(2);
-    
+
     connect(vol_slider, SIGNAL( valueChanged(int) ), this, SLOT(volChanged(int ) ) );
     toolBar->insertWidget(1,2, vol_slider);
 
     fileInfo  = new QFileInfo(HTML_FILE);
     QTimer *t = new QTimer( this );
-    
+
     connect( t, SIGNAL(timeout()), SLOT(updateStatus() ) );
     t->start( 2000, false );
     kdDebug() << "Connecting widget signal" << endl;
-    
-    connect( widget,                      SIGNAL( emitURL( const KURL &)), 
+
+    connect( widget,                      SIGNAL( emitURL( const KURL &)),
              this,                        SLOT( openURLRequest( const KURL &) ) );
     connect( browser->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
              this,                        SLOT( openURLRequest( const KURL & ) ) );
@@ -190,6 +190,7 @@
     if( f_file.open(IO_ReadOnly) )
     {
         QTextStream stream( &f_file );
+        stream.setEncoding( QTextStream::UnicodeUTF8 );
         QString line;
         while ( !stream.atEnd() ) {
             line = stream.readLine(); // line of text excluding '\n'