I am using log4j2 to log message on aix system. In log when I use command less I can see:


when I copy same file on my ubunty system and use same program I can see:


so there is something wrong in my log4j2 configuration so I add charset="UTF-8"

now on aix system I can see:


but when I copy to my ubuntu I can see right values:


So my question is what encoding should I use to see right values on aix and ubuntu system


Set the environment variable LC_CTYPE to the value en_US.UTF-8 to indicate that you want to use the UTF-8 encoding for characters on terminals. UTF-8 is an encoding of Unicode. It is the modern character encoding standard in the Unix world in general, and it is the default on Ubuntu, but it might not be the default on AIX.

The first release of AIX that supports UTF-8 locales is If you have an older version, you might not be able to view UTF-8 encoded text on AIX. However, if you're accessing the AIX machine over SSH from Ubuntu, setting LC_CTYPE=C (or leaving it unset) should work with simple programs such as cat. For other programs such as vi or less, you'll get display glitches as they aren't aware of how several bytes make up a single character.

Alternatively, if you only want the characters you show, you can use the latin2 a.k.a ISO-8859-2 character set. On Ubuntu, in a terminal, you can switch to working in latin2 by running the the command

LC_CTYPE=cs_CZ luit

(Or with any other latin2 locale. If the locale doesn't exist, generate it with sudo locale-gen cs_CZ.)

  • regarding "The first release of AIX that supports UTF-8 locales is" - that is not correct, for the common locales the UTF-8 support is in place since AIX 5.2 and even earlier. Following your link, in Table 1. check the column "Codeset" and the rightmost colum. Even 4.3 had UTF-8 support, see e.g. ualberta.ca/dept/chemeng/AIX-43/share/man/info/en_US/a_doc_lib/… And depending on the language, the OP might need to install additional filesets for UTF-8 support for his locale and depending on the installation. – doktor5000 Aug 23 '15 at 17:42

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.