0

I have a VPS with CentOS 7 installed. I am trying to upload to the server a file that has a Hebrew name. I tried to upload it via FTP (Pure-ftpd) and I get: Failed to convert command to 8 bit charset. I tried to upload it via a php-upload-page and it transfer the file without any name (for example, if the name of the file was שלום.jpg, it will be saved on the server as .jpg. I've already tried to change the locale to en_US.utf8 and he_IL.utf8, but it still not working.

Does anyone know what to do?

EDIT: The problem was in the FTP server (Pure-ftpd). I've uninstalled it and installed ProFtp instead and it works just fine now.

0

How did you make use of en_US.utf8/he_IL.utf8?

You have to pay attention to two things here:

  1. FTP Server

The FTP server is run by a user. You have to make sure it has: LANG=en_US.utf8 or LANG=he_IL.utf8 defined in its environment variable when run.

You can check it by executing

grep -aPo 'LANG=[^=]+' /proc/{pid}/environ

where {pid} is the process id of the FTP server (you might be root to execute this command).

In Linux, it is usually a requirement that this variable is defined in the context of an executable in order for it to support I18n.

If it is not properly defined, then you have several choices:

a. modify the .bashrc of the user assigned to this FTP server:

export LANG=en_US.utf8

and restart the system.

b. More direct, add this environment variable definition directly inside the starting script of FTP server

export LANG=en_US.utf8

  1. FTP Client

The FTP client should also have this LANG environment variable properly set when uploading file in order to properly encode the names.

You can just execute:

export LANG=en_US.utf8

before calling the FTP client on command line for example.

If both client and server are properly configured as described above, and if the application you are using (in your case ftp server and client) supports I18n then there is a big chance that it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.