Kbase P166837: ISO8859-1 characters converted to UTF-8 in output text file
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  27/05/2010 |
|
Status: Unverified
SYMPTOM(s):
ISO8859-1 characters converted to UTF-8 in output text file
Two bytes ñ (hex c3b1) appear in text file where ñ (hex F1) should be when examined in vi editor
FACT(s) (Environment):
ñ character appears correctly when file is displayed using Linux cat command
Text file created using OUTPUT TO and PUT statements
Database created as ISO8859-1
Database started with -cpinternal iso8859-1 -cpstream ISO8859-1
OpenEdge client started with -cpinternal iso8859-1 -cpstream ISO8859-1
LANG environment variable specifies Linux default locale as en_US.UTF-8
Linux
Progress/OpenEdge Product Family
CAUSE:
The text file created by the OpenEdge application contained the correct characters (ñ, hex F1) in the ISO8859-1 code page. However, the vi editor used to examine the file converted those characters to UTF-8 because the default locale in the Linux environment was en_US.UTF-8. This made it appear that the file had been generated incorrectly by the OpenEdge application, when in fact the generated text file contained the correct characters.
FIX:
If unexpected characters are found in text files created by an OpenEdge application, verify that the text editor or other program used to access the file are not introducing them after the file is created.
By default, the vi editor uses the code page of the Linux default locale as specified by the LANG environment variable. To examine a file created in a different code page, override the default value with the preferred encoding. For example:
: set encoding=iso88591