On 22 November 2012 11:35, Adi Roiban <span dir="ltr">&lt;<a href="mailto:adi@roiban.ro" target="_blank">adi@roiban.ro</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 21 November 2012 19:45, Paul Wiseman &lt;<a href="mailto:poalman@gmail.com">poalman@gmail.com</a>&gt; wrote:<br>
&gt; On 21 November 2012 17:35, Paul Wiseman &lt;<a href="mailto:poalman@gmail.com">poalman@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I know this has been asked before, I&#39;ve found it in several trackers.<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://twistedmatrix.com/trac/ticket/5411" target="_blank">http://twistedmatrix.com/trac/ticket/5411</a><br>
&gt;&gt; <a href="http://twistedmatrix.com/trac/ticket/4515" target="_blank">http://twistedmatrix.com/trac/ticket/4515</a><br>
&gt;&gt; <a href="http://twistedmatrix.com/trac/ticket/5100" target="_blank">http://twistedmatrix.com/trac/ticket/5100</a><br>
&gt;&gt;<br>
&gt;&gt; Some of these were created a while ago, some with patches. I wondered what<br>
&gt;&gt; the current status was with regards to utf-8 in ftp? Is it currently<br>
&gt;&gt; possible?<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m trying to list a folder called &#39;Paul’s Mac Pro&#39;, this gets returned as<br>
&gt;&gt; &#39;Paulâ s Mac Pro&#39;. The client tries to list that folder, and the server<br>
&gt;&gt; returns &#39;Paulâ  s Mac Pro: No such file or directory.&#39; I think the client<br>
&gt;&gt; is interpreting the bytes that make up the unicode char as separate ascii<br>
&gt;&gt; characters. (maybe a problem with the client? FileZilla 3.6.0.1)<br>
&gt;&gt;<br>
&gt;&gt; This problem may be made worse by my implementation of IFTPShell, I can<br>
&gt;&gt; try to make an example if this isn&#39;t the expected result.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m returning all names and paths back encoded in utf-8, but maybe the<br>
&gt;&gt; problem is the client isn&#39;t expecting it because there&#39;s no FEAT command (is<br>
&gt;&gt; the patch in 4515 ok to add?)<br>
&gt;&gt;<br>
&gt;&gt; I just want to get an idea of how I can best go about getting this to<br>
&gt;&gt; work. Will I need to build in support, or is it available in a newer<br>
&gt;&gt; version, or by applying some patches?<br>
&gt;&gt;<br>
&gt;&gt; Thanks very much!!<br>
&gt;&gt;<br>
&gt;&gt; Paul<br>
<br>
</div>The patch from #4515 does little to provide a functional UTF-8 FTP<br>
implementation.<br>
It is there only to help advertise future implementation of UTF-8 support.<br>
<br>
Thanks for reminding about #5411 . I have submitted a patch for review<br>
together with required tests.<br>
<br>
I have a few more FTP ticket in work/waiting for review. As soon as<br>
they are done, I will look at UTF-8 support.<br>
<br></blockquote><div><br></div><div>Awesome- sounds good! I&#39;ll keep an eye out for it! :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
----<br>
<br>
Patch #4515 is already in trunk, and together with patch for #5411 it<br>
should be a good start for UTF-8 support.<br>
<br>
Ticket #5100 is mainly about the default IFTPShell implementation, but<br>
if you have your own IFTPShell implementation just make sure it<br>
accepts input as str encoded utf-8 and that it output str encoded<br>
utf-8<br></blockquote><div><br></div><div>My IFPShell does this, I have crudely added ftp_FEAT and ftp_OPT to a subclass of FTP which returns UTF8 in the list of features and responds with CMD_OK for &quot;UTF8 ON&quot; OPT. Which will hopefully get me by until there is support.</div>
<div><br></div><div>I&#39;d like to help add support, but I&#39;m not sure how you&#39;d do it. The FTP protocol needs to know what to return if a client asks UTF8 ON in OPT, but it&#39;s up to the shell which needs to make sure it complies with this option and return things in the right encoding? unless everything is returned in unicode and the FTP protocol encodes it if utf8 is on, or throws an error if anything is outside an ascii range.</div>
<div><br></div><div>but there are certain parts of it sound quite tricky to get right:</div><div><br></div><pre class="newpage" style="font-size:1em;margin-top:0px;margin-bottom:0px">   &quot;Prior to transmitting response code 200 in response to the OPTS UTF-8</pre>
<pre class="newpage" style="font-size:1em;margin-top:0px;margin-bottom:0px">   command, the Server-FTP must not transmit UTF-8 encoded pathnames and
   should not accept them on commands: the Server-FTP should transmit
   either response code 501 or 553 in reply to any command which
   includes a pathname outside the range of 7-bit ASCII; and the Server-
   FTP should transmit response code 550 in reply to any command to
   which the server would otherwise have sent a UTF-8 encoded pathname.&quot;</pre><div>     <a href="http://tools.ietf.org/html/draft-ietf-ftpext-utf-8-option-00#page-6">http://tools.ietf.org/html/draft-ietf-ftpext-utf-8-option-00#page-6</a></div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Adi Roiban<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</font></span></blockquote></div><br>