LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 04-20-2013, 07:18 PM   #1
elesmod
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 86

Rep: Reputation: Disabled
vsftpd (or mozilla?) and encoding


I've set up an FTP server on my headless Slackware64 13.37 machine. If I put files with polish diacritical signs (utf-8) in their names and browse them in Seamonkey or Firefox, they appear as gibberish (to me at least). I can switch the encoding in the browsers to uft-8 and then they appear fine, but shouldn't this be done automatically?

So, a file named "ęąśżźćń.txt" appears like shown in the attachment.

However, in Konqueror and in the text based "ftp" client, the encoding is set correctly and the file looks like it should.

From what I've gathered, looking around the Internet, vsftpd sets the encoding according to the system's locale, and mine's:

Code:
$ locale
LANG=pl_PL.utf8
LC_CTYPE="pl_PL.utf8"
LC_NUMERIC="pl_PL.utf8"
LC_TIME="pl_PL.utf8"
LC_COLLATE=C
LC_MONETARY="pl_PL.utf8"
LC_MESSAGES="pl_PL.utf8"
LC_PAPER="pl_PL.utf8"
LC_NAME="pl_PL.utf8"
LC_ADDRESS="pl_PL.utf8"
LC_TELEPHONE="pl_PL.utf8"
LC_MEASUREMENT="pl_PL.utf8"
LC_IDENTIFICATION="pl_PL.utf8"
LC_ALL=
What am I doing wrong? Or maybe it's Firefox's and Seamonkey's fault?
Attached Images
File Type: png encoding.png (1.3 KB, 3 views)

Last edited by elesmod; 04-20-2013 at 07:20 PM.
 
Old 04-21-2013, 12:36 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,246

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Ftp server do not send to client which charset it use. You need to configure ftp client application, for example in Firefox, you can set UTF8 in "Edit/Preferences/Content/Fonts & Colors", button "Advanced".
 
1 members found this post helpful.
Old 04-21-2013, 12:54 PM   #3
rg3
Member
 
Registered: Jul 2007
Distribution: Slackware Linux
Posts: 514

Rep: Reputation: Disabled
It's probably a Firefox bug, but apparently you can set the language to use during an FTP session (see RFC), so there's a very small chance it could be considered an FTP server bug. You'd need to analyze the network traffic to see if Firefox issues a LANG command or not.

https://tools.ietf.org/html/rfc2640
 
1 members found this post helpful.
Old 04-21-2013, 02:00 PM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,676

Rep: Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237
The problem is that there is no 100% sure way to detect the encoding of a text string, so the program which read it has to use some kind of heuristic and make assumptions.

This program can rely on a shell variable like LANG or not.

I would type "about:config" in Firefox and try to play with the settings filtered searching for "utf", in the hope one is useful for that purpose.

I don't know if a specification for these settings is available.

Last edited by Didier Spaier; 04-21-2013 at 02:02 PM.
 
1 members found this post helpful.
Old 04-23-2013, 08:41 AM   #5
elesmod
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 86

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by eSelix View Post
in Firefox, you can set UTF8 in "Edit/Preferences/Content/Fonts & Colors", button "Advanced".
This helps a little, but other people connecting to my FTP server won't have that utf8 as default setting in Firefox.

Quote:
Originally Posted by rg3 View Post
apparently you can set the language to use during an FTP session (see RFC)

(...)

You'd need to analyze the network traffic to see if Firefox issues a LANG command or not.

https://tools.ietf.org/html/rfc2640
I've started reading that memo, but it's too complicated for me. It seems it was written for the people who created the FTP protocol :P
Also, no idea how to analyze the network traffic to see if Firefox issues a LANG command.

Quote:
Originally Posted by Didier Spaier View Post
The problem is that there is no 100% sure way to detect the encoding of a text string

(...)

I would type "about:config" in Firefox and try to play with the settings filtered searching for "utf"
The same issue as I've mentioned above, I can't make everyone connecting to my server change their browser settings.

Since it's not something I can set up with "encoding=utf8" in a vsftpd config file, I guess I'll just avoid using non-ASCII letters.

Thanks for your replies, guys.

Last edited by elesmod; 04-23-2013 at 08:42 AM.
 
Old 04-23-2013, 09:07 AM   #6
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,676

Rep: Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237
Quote:
Originally Posted by elesmod View Post
Since it's not something I can set up with "encoding=utf8" in a vsftpd config file, I guess I'll just avoid using non-ASCII letters.
This is kind of a paradox, as ASCII is a subset of UTF-8
 
Old 04-23-2013, 10:10 AM   #7
comet.berkeley
Member
 
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 153

Rep: Reputation: Disabled
The Filezilla FTP client site has a good discussion of the issue where ftp servers or clients don't follow RFC 2640 close enough:

https://wiki.filezilla-project.org/Character_Set

Last edited by comet.berkeley; 04-23-2013 at 10:19 AM. Reason: shorten posting
 
2 members found this post helpful.
Old 04-24-2013, 09:36 AM   #8
elesmod
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 86

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by comet.berkeley View Post
The Filezilla FTP client site has a good discussion of the issue where ftp servers or clients don't follow RFC 2640 close enough:

https://wiki.filezilla-project.org/Character_Set
Thanks for that link, comet.berkeley. It pushed me to do some more digging.

Here's what I've found:
Quote:
Originally Posted by vsftpd changelog.txt (you can click this link)
v2.0.5 released!
- Pretend we have proper UTF8 support and respond positively to OPTS UTF8 ON.
Pretend?

Quote:
Originally Posted by Red Hat Customer Portal
* The vsftpd server previously did not support the UTF-8 feature. This update
implements the UTF-8 feature for the vsftpd server in accordance with the
Internationalization of the File Transfer Protocol (RFC 2640) standard.
Quote:
Originally Posted by vsftpd-3.0.2 REFS file
(Not implemented in vsftpd):
RFC-2640. Deals with internationalization and the LANG command. I'm not seeing
any vsftpd users with requirements in this area.
Eh? Maybe vsftpd is RFC-2640 compliant, and someone forgot to update that REFS file?

I've tried the following ftp clients:
ftp, ncftp, FileZilla, FireFTP (Firefox addon), Total Commander
and all of them displayed my files with diacritical signs correctly (which means they used utf8).

Moreover, when sending FEAT command in FileZilla, the response I received from my FTP server was:
Quote:
211-Features:
EPRT
EPSV
MDTM
PASV
REST STREAM
SIZE
TVFS
UTF8
211 End
Which means (I think), that most ftp clients are ok and only some web browsers are not compliant with RFC-2640.
I've tested 5 of them (green=ok; red=not_ok):
SeaMonkey 2.17.1
Firefox 20.0
Internet Explorer 9
*gasp*
Konqueror 4.8.5
Google Chrome 26.0.1410.63
(installed specifically to test this)

Last edited by elesmod; 04-24-2013 at 09:46 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd and Mozilla firefox problem sohailkmu Linux - Networking 2 12-29-2008 12:18 AM
Vsftpd: can't access from Mozilla or IE hmartires Linux - Server 1 06-05-2008 09:51 AM
Vsftpd: can't access from Mozilla or IE hmartires Linux - Networking 0 06-03-2008 02:07 PM
Mozilla Firefox Encoding Issues Kenji Miyamoto Linux - Software 3 05-27-2005 07:31 PM


All times are GMT -5. The time now is 03:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration