Bug 56197 - ftp needs to support multiple encodings
Summary: ftp needs to support multiple encodings
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: kioslave (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Thiago Macieira
URL:
Keywords:
: 27446 55316 56178 58839 60456 61727 68688 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-21 06:09 UTC by Choe Hwanjin
Modified: 2004-01-30 23:47 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
a patch for QString encodings. (5.51 KB, patch)
2003-03-21 06:11 UTC, Choe Hwanjin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Choe Hwanjin 2003-03-21 06:09:39 UTC
Version:            (using KDE KDE 3.1.1)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.2 20020903 (HancomLinux 3.0 3.2-7hl) 

Current kioslave ftp does not support korean letters(hangul) in path. Many users in korea use korean letters on ftp path so QString::ascii() method is not recommanded. 
I suggest a patch file.
Comment 1 Choe Hwanjin 2003-03-21 06:11:51 UTC
Created attachment 1213 [details]
a patch for QString encodings.

This patch makes ftp kioslave work correctly when path is composed of korean
letters.
Comment 2 Thiago Macieira 2003-03-21 23:53:10 UTC
Sorry, but I don't think we can accept that patch. 
 
Yes, I know it solves your problem, but it doesn't solve the general issue. We 
cannot simply assume every FTP server a user connects to will be using the same 
local 8-bit encoding that he's using. 
 
A more general solution might have to be found in order to force the ioslaves' 
reading into another encoding. 
Comment 3 Thiago Macieira 2003-03-21 23:54:21 UTC
*** Bug 55316 has been marked as a duplicate of this bug. ***
Comment 4 Thiago Macieira 2003-03-22 18:13:21 UTC
*** Bug 56178 has been marked as a duplicate of this bug. ***
Comment 5 Choe Hwanjin 2003-03-24 10:52:45 UTC
Actually you are right. But I suggest a feature.  
How about offering user costumizable encoding option?. 
Although FTP protocol does not support encoding information, it's better for users to set encoding 
option.  Default value should be locale encoding, and she/he can change encoding at any time. 
I think it's no different to user that he/she can't read filenames because of wrong encoding or  
latin1 chars. 
Comment 6 Thiago Macieira 2003-03-24 12:49:08 UTC
Subject: Re:  does not support korean letters(hangul) on ftp

Indeed, that's what I planned. I'm not sure if it'll be me to implement that, 
but I guess it wouldn't be too hard. We'd present the user a new option 
inside the View menu, that would be to set the remote system's filename 
encoding. Even if you connect to lots of Korean FTPs, imagine you end up in a 
German FTP and kio_ftp "chokes" because it doesn't recognise the encoding in 
filenames.

It should also be noted that this won't affect the local encoding of 
filenames. Which means that there could be problems when saving files whose 
names cannot be encoded locally. That should, however, not be a problem soon, 
since we're moving fast to UTF-8, that can encode anything :-)

Comment 7 Thiago Macieira 2003-05-24 02:29:13 UTC
*** Bug 58839 has been marked as a duplicate of this bug. ***
Comment 8 Thiago Macieira 2003-06-28 12:46:35 UTC
*** Bug 60456 has been marked as a duplicate of this bug. ***
Comment 9 Thiago Macieira 2003-07-27 22:47:11 UTC
*** Bug 61727 has been marked as a duplicate of this bug. ***
Comment 10 Maksim Orlovich 2003-11-20 20:33:30 UTC
*** Bug 68688 has been marked as a duplicate of this bug. ***
Comment 11 Thiago Macieira 2003-11-24 04:25:29 UTC
Ok, I think I've got it working now. It consists of a couple of modifications to KIO::SlaveBase, a Konqueror plugin and the updated ioslaves.

I've got it working for FTP, but I'll see if I can make FISH and SFTP work as well. Also note that Konqueror will choke on undecodeable filenames.

Meanwhile, I'm having problems making Konqueror reload the page from within the plugin. If another developer has an idea how to do so, help would be appreciated.

PS: this code won't make into KDE 3.2
Comment 12 Nick Shaforostoff 2003-12-09 20:28:49 UTC
and russian charsets too:
koi8-u (koi8-r is bad cuz it containes no Ukrainian letters)
cp1251
utf8
Comment 13 Thiago Macieira 2003-12-11 01:58:28 UTC
Thanks for the reminder. All encodings supported by KDE are included in the patch. For a list, check the View | Encoding menu in Konqueror or KWrite.
Comment 14 Thiago Macieira 2004-01-12 19:12:40 UTC
*** Bug 27446 has been marked as a duplicate of this bug. ***
Comment 15 Thiago Macieira 2004-01-30 17:19:11 UTC
Subject: kdebase/konqueror/remoteencodingplugin

CVS commit by thiago: 

Added plugin to Konqueror to allow selection of the charset used in
remote filenames and paths. This fixes bug #56197. The new menu entry
is available on the Tools menu for all DirListViews except file:/.

Support in ioslaves is required to make this work. Currently only
the FTP ioslave supports this. I'll be opening bug tickets to sftp and
fish.

CCMAIL:56197-done@bugs.kde.org


  A            .cvsignore   1.1
  A            Makefile.am   1.1
  A            kremoteencodingplugin.cpp   1.1 [LGPL (v2+)]
  A            kremoteencodingplugin.h   1.1 [LGPL (v2+)]
  A            kremoteencodingplugin.rc   1.1



Comment 16 Ken Deeter 2004-01-30 23:06:09 UTC
Does this mean a user has to open the setting window to change the encoding for the current file listing? Seems to me there should be an quicker way to do it (for example, in the view menu like when browsing webpages) that would set the encoding and reload.

Also, it would be nice to be able to specify several encodings that are tried in order to do an autodetection. For languages that have several different encodings (chinese, japanese, russian) this can be quite useful and save a lot of time.
Comment 17 Thiago Macieira 2004-01-30 23:47:32 UTC
No, it's in the Tools menu, where you should be seeing now things like "Change Browser Identification". (actually, my plugin was based on that one)

Sorry, but there's no way to specify a list of encodings to try. Not now, anyways.

PS: one outstanding bug is that the listing isn't reloaded and updated automatically. I couldn't get it done.