Editing Character Encoding

From FileZilla Wiki
Jump to navigationJump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
Users sometimes encounter problems with FTP transfers that garble non-English characters in filenames, such as umlauts, accented letters or completely different scripts like Chinese or Arabic.
+
FTP is a rather old protocol and things we take for granted now were not even considered 20 years ago. One of these things is support for non-English characters. When the FTP protocol was designed, computers mostly spoke English and were unable to display any non-English characters like umlauts, accented letters or even completely different scripts like for example Chinese.
 +
As such, the FTP protocol has been designed to be used with English characters only, namely 7-bit ASCII.
  
FTP is a rather old protocol and things we take for granted now were not even considered when it was designed. One of these things is support for non-English characters in filenames. When the FTP protocol was designed, computers mostly spoke English and were unable to display any non-English characters. As such, the FTP protocol was designed to be used with English characters only, namely 7-bit ASCII.
+
The problem is that many FTP clients and servers purposely violate the FTP specifications in order to support other, non-standard character sets. Which of these character sets are used is not subject to any negotiation and completely arbitrary. For any character set in existence, you can find a server using it with no way of detecting the proper encoding.
  
The problem is that many FTP clients and servers purposely violate the FTP specifications in order to support other, non-standard character sets. Which of these character sets are used is not subject to any negotiation. For any character set in existence, you can find a server using it with no way of detecting the proper encoding. The result: non-English characters are not transferred correctly.
+
To solve this problem, the FTP protocol has been extended in a backwards compatible way to use UTF-8 as character set, which is a strict superset of the previously used character set. Note that this obviously can only be backwards compatible with servers in compliance with the original specifications.
 
 
To solve this problem, the FTP protocol has been extended in a backwards compatible way to use UTF-8 as the character set. (This solution is backwards compatible only with servers in compliance with the original specifications.)
 
  
 
If you have problems with filenames containing any foreign characters, this can have two reasons:
 
If you have problems with filenames containing any foreign characters, this can have two reasons:
 
* The server or client follows the original specifications by the letter and rightfully rejects those filenames
 
* The server or client follows the original specifications by the letter and rightfully rejects those filenames
* The server or client violates the specifications and uses a custom encoding that the other party does not understand
+
* The server or client violates the specifications and uses a custom encoding
  
Both FileZilla Client and Server are fully compliant with the updated specifications and use UTF-8. FileZilla will not break FTP specifications by supporting non-standard encodings in order to accommodate the user.
+
Note that both FileZilla Client and Server are fully compliant with the updated specifications and use UTF-8.
  
If you have problems with other clients or servers, please upgrade (or ask the server to upgrade) to FTP software capable of UTF-8 or refrain from using foreign characters. Anything else is in violation of the FTP specifications and will only work if you manually ensure that the server and client use the same character encoding (which may not even be possible).
+
If you have problems with other clients or servers, please upgrade to FTP software capable of UTF-8 or refrain from using foreign characters. Anything else is in violation to the FTP specifications and does not work.
  
 
== Technical details ==
 
== Technical details ==
  
The FTP protocol is specified in [http://filezilla-project.org/specs/rfc0959.txt <nowiki>RFC 959</nowiki>], which was published in 1985. The FTP protocol is designed on top of the original Telnet protocol, which is specified in [http://filezilla-project.org/specs/rfc0854.txt <nowiki>RFC 854</nowiki>]. The relevant sections of the Telnet specification regarding FTP are those covering the Network Virtual Terminal (NVT).
+
The FTP protocol is specified in [http://filezilla-project.org/specs/rfc0959.txt <nowiki>RFC 959</nowiki>], which got published in 1985. The FTP protocol is designed on top of the original Telnet protocol, which is specified in [http://filezilla-project.org/specs/rfc0854.txt <nowiki>RFC 854</nowiki>]. The relevant sections of the Telnet specification regarding FTP are those covering the Network Virtual Terminal (NVT).
According to [http://filezilla-project.org/specs/rfc0854.txt RFC 854], the NVT requires the use of (7-bit) ASCII as the character set. Use of any other character set requires explicit negotiation. This character set only contains 127 different characters: English letters and numbers, punctuation characters and a few control characters. Accented letters, umlauts or other scripts are not contained in the ASCII character set.
+
According to [http://filezilla-project.org/specs/rfc0854.txt RFC 854], the NVT requires to use 7-bit ASCII as character set with any other character set being subject of explicit negotiation. This character set only contains 127 different characters: English letters and numbers, punctuation characters and a few control characters. Accented letters, umlauts or other scripts are not contained in the ASCII character set.
 
 
In order to support non-English characters, the FTP specifications were extended in 1999 in [http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>]. This extension requires the use of UTF-8 as the character set. This character set is a strict superset of ASCII, every valid ASCII character is also the same character in UTF-8. The UTF-8 character set can display any valid Unicode character. That includes umlauts, accented letters and also different scripts.
 
This extension is fully backwards compatible with [http://filezilla-project.org/specs/rfc0959.txt <nowiki>RFC 959</nowiki>].
 
  
As long as you're using only English characters, it doesn't matter if the software you are using supports RFC 2640 or not. However, if you use non-English characters without using RFC 2640 compatible software, there will be problems--problems which are entirely self-made by not obeying the specifications.
+
In order to support non-English characters, the FTP specifications have been extended 1999 in [http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>]. This extension requires the use of UTF-8 as character set. This character set is a strict superset of ASCII, every valid ASCII character is also the same character in UTF-8. The UTF-8 character set can display any valid Unicode character. That includes umlauts, accented letters and also different scripts.
 +
This extension is fully backwards compatible. As long as you're not using any non-English characters, it doesn't matter if the used software supports RFC 2640 or not. Note that if you used non-English characters before using RFC 2640 compatible software, there will be problems. Problems which are entirely self-made by not obeying the specifications.
  
 
=== UTF8 feature negotiation ===
 
=== UTF8 feature negotiation ===
Line 39: Line 36:
 
=== Conflicting specification ===
 
=== Conflicting specification ===
  
There exists a long expired [http://tools.ietf.org/html/draft-ietf-ftpext-utf-8-option-00 IETF draft] that is in conflict with [http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>]. This draft also requires the FEAT response to include UTF8, but in addition requires the client to send '''OPTS UTF-8 ON''' to enable UTF-8 support.
+
There exists a long expired [http://tools.ietf.org/html/draft-ietf-ftpext-utf-8-option-00 IETF draft] that is in conflict to [http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>]. This draft also requires the FEAT response to include UTF8, but in addition requires the client to send '''OPTS UTF-8 ON''' to enable UTF-8 support.
  
 
If an [http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>] compliant client sends '''OPTS UTF-8 ON''', it has to use UTF-8 regardless whether '''OPTS UTF-8 ON''' succeeds or not.
 
If an [http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>] compliant client sends '''OPTS UTF-8 ON''', it has to use UTF-8 regardless whether '''OPTS UTF-8 ON''' succeeds or not.
Line 45: Line 42:
 
[http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>] compliant servers ''must not'' make UTF-8 dependent on '''OPTS UTF-8 ON'''.
 
[http://filezilla-project.org/specs/rfc2640.txt <nowiki>RFC 2640</nowiki>] compliant servers ''must not'' make UTF-8 dependent on '''OPTS UTF-8 ON'''.
  
=== SFTP ===
+
== SFTP ==
  
The situation for SFTP is similar to the one for FTP. Current versions of the SFTP specifications (beginning with version 4) require filenames to be encoded as UTF-8.
+
The situation for SFTP is similar to the one of FTP. Current versions of the SFTP specifications require filenames to be encoded as UTF-8, beginning with version 4 of the SFTP specifications.
  
 
However, the most commonly used SFTP protocol version is version 3 as implemented in OpenSSH. This version of the SFTP specifications does not require UTF-8. In fact it does not say anything about the encoding.
 
However, the most commonly used SFTP protocol version is version 3 as implemented in OpenSSH. This version of the SFTP specifications does not require UTF-8. In fact it does not say anything about the encoding.
It is however reasonable to assume UTF-8 on those servers for the following reasons:
+
It is however reasonable to assume UTF-8 on those servers anyhow for the following reasons:
 
* The later protocol versions require UTF-8
 
* The later protocol versions require UTF-8
 
* The SSH protocol, under which SFTP operates, already requires UTF-8
 
* The SSH protocol, under which SFTP operates, already requires UTF-8

Please note that all contributions to FileZilla Wiki are considered to be released under the GNU Free Documentation License 1.2 (see FileZilla Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)