Put file or folder in another agent action changing characters in text file

Document ID : KB000008911
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

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.

Environment:
Release Automation: 6.3, 6.4, 6.5 and may apply to future higher version
Cause:

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=

 

Resolution:

There are two options to resolve this issue and are listed below.

  1. Try to match the locale and file encoding configuration of the source and target server at Operating system level
  2. Change the character-set of the files before executing the scripts