Use case: We have a harvest server, where we download file from the harvest repository and then transfer them to another server which is used as a pivot to access many different databases.
Problem: These are *.sql files, with some special symbols like tildes (á / é / í / ó / ú), common characters in Spanish. The files in the harvest server while viewing via vi looks fine, but when we copy these files to target server using "put file or folder in remote agent" special characters are changed to "squares" and hence *sql script execution fails.
During review of the environment we found that modification of special characters in file on target server is happening due to difference in the file-encoding and locale configuration of Operating system on source and target server.
For example:
AIX Server | Linux Redhat |
# locale LANG=C LC_COLLATE="C" LC_CTYPE="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_MESSAGES="C" LC_ALL= | LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= |
There are two options to resolve this issue and are listed below.