login about faq

I seem to be having a problem with downloading Japanese file names. These are supposed to be UTF-8 but I have also tried [Shift_JIS EUC-JP EUC-CN] with the same result (put_DirListingCharset).

From the lastErrorXml it looks like the Japenese part of the file is gone?

asked Apr 21 '14 at 12:21

chilkat's gravatar image

chilkat ♦♦
11.8k316358421


The DirListingCharset property tells Chilkat how to interpret the bytes of a directory listing.

What you want instead is to set the CommandCharset property -- to tell the FTP server how to interpret the bytes in the commands sent over the control connection.

In addition, you'll need to ensure that for the string passed to a Chilkat method, that the bytes are correctly interpreted. If the Ruby string is utf-8, make sure to set the "Utf8" property of the Chilkat FTP2 object. For example:

    ftp.put_Utf8(true)

Remember: In Ruby, a String object holds and manipulates an arbitrary sequence of bytes, typically representing characters. Chilkat however, must know how to interpret the bytes, and therefore needs to know if you are passing bytes representing characters using the ANSI encoding (whatever that may be for the local machine, which may be Shift-JIS for Japanese computers), or utf-8.

In summary:

Step 1 is to make sure the string is passed to Chilkat so that Chilkat correctly interprets the bytes.

Step 2 is to make sure the string is passed to the FTP server using the character encoding expected by the FTP server, so that it can correctly interpret the bytes. This is done by setting the CommandCharset property.

link

answered Apr 21 '14 at 12:31

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×90
×3
×2

Asked: Apr 21 '14 at 12:21

Seen: 1,065 times

Last updated: Apr 21 '14 at 12:31

powered by OSQA