login about faq

I have a Ruby test and a Java test that simply connects to a test server and displays the output of a directory (dirTreeXml). Both are using the latest versions of chilkat and the Ruby version is 2.1.5 (tested w/ 2.1.1, same result).

The Java version works as expected, however some wide characters are stripped off the file names when testing with Ruby. You can test/replicate using the sent scripts, the connection will work.

asked Dec 24 '14 at 08:55

chilkat's gravatar image

chilkat ♦♦

I have a feeling that this is just a matter of telling the CkFtp2 object that you want strings to be utf-8 when passed to the Chilkat API and returned from the Chilkat API. This is different than the FTP2's DirListingCharset and CommandCharset properties, which control the charset used in communications between Chilkat and the FTP server. I'm talking about the strings passing between the app and Chilkat. In Java, it can only be utf-8 -- there is no other choice because in Java strings are effectively objects (and utf-8 when emitting to stdout). In Ruby however, strings are really just a null-terminated sequence of bytes. The default is to assume ANSI -- and it's because of this that your chars get dropped (because there is no single-byte ANSI representation for those chars). You want to tell the CkFtp2 that it should treat strings passed in as utf-8, and return utf-8 strings, and this is via the Utf8 property:



answered Dec 24 '14 at 08:57

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: Dec 24 '14 at 08:55

Seen: 720 times

Last updated: Dec 24 '14 at 08:57

powered by OSQA