No way to pass encoding when opening documents
Submitted by Alexander E. Patrakov
Assigned to Allison Lortie @desrt
Description
This is a duplicate of https://bugs.kde.org/show_bug.cgi?id=97167, https://bugs.kde.org/show_bug.cgi?id=161777 and https://bugs.kde.org/show_bug.cgi?id=167755
Konqueror opens kwrite for viewing source of HTML documents and knows their encoding from HTTP headers, but the existing specifications don't specify a way to pass the "--encoding ???" switch to kwrite. The result is that this useful switch is not passed by konqueror, and kwrite assumes that the document is in the system locale encoding, which is not always true. The user sees garbage characters and has to correct the encoding through the menu in kwrite, even though konqueror knew it.
Please extend the desktop-file and mime-database specifications so that the statement "if the encoding of the document is known, it should be passed to the program after this switch" can be expressed.
I.e.: it should be possible to write a desktop file that tells that kwrite should be started as "kwrite" if there is no document, as "kwrite /home/user/document.txt" if the encoding of document.txt is not known in advance, and as "kwrite --encoding KOI8-R /home/user/document.txt" if the application that wants to run kwrite knows in advance that document.txt is in KOI8-R.
Also it should be possible to say: "I don't know the encoding of document.txt, but want to open it anyway with the user's preferred application" (resulting in "kwrite document.txt") and "I know that the encoding of document.txt is KOI8-R and want to open it with the user's preferred application, passing the encoding information to it" (resulting in "kwrite --encoding KOI8-R document.txt").