Perforce Public Knowledge Base - How to display non UTF-8 characters on Linux
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



How to display non UTF-8 characters on Linux

« Go Back


Many Linux distributions use a default character encoding of UTF-8. When submitting files on Linux with default local of UTF-8, file names or changelist  descriptions containing non UTF-8 characters do not render properly. Non UTF-8 characters will be displayed with a  question mark.
To solve this issue, there are two possible solutions:
  1. Switch your Perforce Server to the Unicode enabled mode.
This solution will help only if your character encoding is supported by Perforce. Switching the server to 'unicode mode', also called 'i18n mode', is a decision that affects all Perforce users and should not be made lightly.
See KB article "Internationalization and Localization" for more details.

Switching to Perforce 'unicode mode'  requires that you set the P4CHARSET environment variable (command line) or character encoding (P4V) to UTF-8 for all clients connecting to the server.  This also causes Perforce client programs to translate the contents of files of type "unicode" to UTF-8.

For a full list of supported character encoding run the following command:
p4 help charset
  1. Change the locale of your Linux environment.
For the command line shell (Terminal), you can change the character encoding of your terminal using the menu "Terminal > Set Character Encoding".

For P4V, check if your character encoding is installed in your Ubuntu environment by running:
locale -a

If your preferred character encoding is not installed, perform the following steps to install it:

a) Add your character encoding to /var/lib/locales/supported.d/local (for example "en_GB ISO-8859-1")
b) Run the following command:

sudo locale-gen

    Now you can start P4V using your newly installed character encoding, for example:

    LC_ALL="en_GB.iso88591" p4v


    Related Links



    Was this article helpful?



    Please tell us how we can make this article more useful.

    Characters Remaining: 255