Bug 190608 - KIO::SlaveInterface reports non-Latin1 file name errors using wrong encoding
Summary: KIO::SlaveInterface reports non-Latin1 file name errors using wrong encoding
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 185690 240427 275289 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-25 11:42 UTC by David Jarvie
Modified: 2017-10-28 17:10 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Jarvie 2009-04-25 11:42:06 UTC
Version:            (using KDE 4.2.2)
Compiler:          gcc 4.3 
OS:                Linux
Installed from:    Compiled From Sources

The application is using Phonon to access an audio file whose file name is in the Greek alphabet. This file name is shown correctly in the debug output for KIO::Slave::createSlave(), as below. When KIO errors due to not finding the file, it reports the file name using a Latin1 encoding instead of UTF8 or whatever. The debug output below shows this, but more importantly the error text which is emitted by KIO::SlaveInterface::dispatch() contains the file name in the wrong encoding too. As a result, error messages displayed to the user by the application are also wrong.


kalarm(9755)/kio (Slave) KIO::Slave::createSlave: createSlave "file" for KUrl("file:///home/fanisatt/Music/ΣΥΝΘΕΣΕΙΣ_MOY/LAST/Swallows of April_fin.wav")                                               
kalarm(9755)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-david/kalarmTJ9755.slave-socket"                                                             
kalarm(9755)/kio (KIOJob) KIO::SlaveInterface::dispatch: error  111   "/home/fanisatt/Music/ΣΥÎÎÎΣÎÎΣ_MOY/LAST/Swallows of April_fin.wav"
Comment 1 Maksim Orlovich 2009-04-25 16:45:12 UTC
Î = CE
£ = A3
.. Which decodes to U+03A3  GREEK CAPITAL LETTER SIGMA.
Comment 2 Maksim Orlovich 2009-04-25 16:49:35 UTC
.. What's your locale?
Comment 3 Maksim Orlovich 2009-04-25 18:34:52 UTC
Never mind --- spoke to thiago. Problem is that kio_file passes a QByteArray with encoded name to QString-taking method, and QString(QByteArray) by default does latin1.
Comment 4 Dawit Alemayehu 2011-05-14 20:06:43 UTC
Is this still applicable in KDE 4.6 or has the issue been resolved ?
Comment 5 Dawit Alemayehu 2011-05-26 03:29:29 UTC
(In reply to comment #3)
> Never mind --- spoke to thiago. Problem is that kio_file passes a QByteArray
> with encoded name to QString-taking method, and QString(QByteArray) by default
> does latin1.

There is nowhere where I see that happening in the current version of kio_file. That is I do not see a direct QByteArray to QString conversion. Either QFile::decodeName or KUrl's toLocalFile() is used to obtain the filename information sent in error messages. This is especially true for the error, ERR_DOES_NOT_EXIST (111), shown in the original report's debug output snippet.
Comment 6 David Jarvie 2011-07-30 19:44:08 UTC
As far as I can tell, this doesn't happen any more. I haven't managed to reproduce any of the KIO debug messages, but the error message returned by Phonon::MediaObject contains the correctly encoded file name, which is then displayed correctly to the user.
Comment 7 Nate Graham 2017-10-28 15:32:42 UTC
*** Bug 240427 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2017-10-28 15:32:53 UTC
*** Bug 185690 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2017-10-28 17:10:21 UTC
*** Bug 275289 has been marked as a duplicate of this bug. ***