login about faq

I have basically this code (simplified):

CkFtp2 ftp;
.....
ftp.put_Password(L"äëü~`€"); // a pwd with "weird" characters
ftp.connect(); // connect works
ftp.disconnect();
ftp.connect(); // this connect fails (wrong password)

After a lot of searching and debugging I discovered the issue: At the first connect Chilkat uses the default "ansi" encoding for the password. My ftp supports UTF-8 so chilkat automatically sets the Command Charset to "utf-8". At the second connect chilkat will send the password using the utf-8 charset and I guess that is not expected by the FTP server.

I understand why Chilkat switches to utf-8, but I think chilkat should always use ansi while connecting.

asked Feb 12 at 02:15

Gert's gravatar image

Gert ♦
629141824

edited Feb 12 at 02:17


Thanks Gert,

This is a difficult problem, and I'm not sure there's a resolution other than having the app explicitly set CommandCharset before the connect. It may be that some FTP servers expect the login/password to be utf-8. If Chilkat always sent ANSI, then it would be impossible to satisfy those servers. So the solution is one of the following:

  1. Use a new instance of the CkFtp2 object for each new connection.
  2. Explicitly set the CommandCharset property = "ANSI" before calling Connect.
link

answered Feb 12 at 10:18

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

I agree FTP servers are weird and implementing a "fix" will break software of other customers.

I will implement a work-around for customers that need it.

link

answered Feb 12 at 14:02

Gert's gravatar image

Gert ♦
629141824

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:

×27
×21
×19
×9

Asked: Feb 12 at 02:15

Seen: 479 times

Last updated: Feb 12 at 14:02

powered by OSQA