Unable to Import Keys - ERROR: invalid byte sequence for encoding "UTF8"


Article ID: 153303


Updated On:


Symantec Products




When attempting to import a user's key which contains special characters (Ä,Ö,Ü,ß,â, ê, î...) created with a version of PGP Desktop prior to version 8.x to the PGP Universal Server, the key is not imported to the server and an error is displayed in the logs of the server.

When checking the server logs you may see the following error message: ERROR: invalid byte sequence for encoding "UTF8": 0xf36e878d HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

PGP Keys created in versions prior to version of PGP Desktop 8.x do not observe RFC 2440 standards which mandate the User ID to use UTF-8. The default character set for text RFC 2440 is the UTF-8. PGP Universal Server requires all User IDs to comply with RFC 2440.




To resolve this issue, you must create a new User ID for the key using PGP Desktop 8.x or above and then delete the old User ID from the key. The new User ID is created using UTF-8 and allows the PGP Universal Server to successfully import the key.

This example uses PGP Desktop 9.x, however PGP Desktop 8.x may also be used.

Create New UserID


  1. Copy the exported key file to a system with PGP Desktop.
  2. Double-click the .asc file for the key to import the key.
  3. Click Import on the Select key(s) screen.
  4. Click OK to close the PGP Information alert.
  5. Open PGP Desktop and select PGP Keys from the control box.
  6. Double-click the key. (The key properties are displayed).
  7. Click the arrow next to Trust and click Implicit to change the trust status of the key.
  8. Click Add Email Address at the top of the key properties.
  9. Enter a Username and Email Address for the key and click OK.

This will create a new User ID for the key. You can use the same Username and Email Address, but the new User ID is created using UTF-8.


  1. Enter the passphrase for the key and click OK.
  2. Click X to close the key properties.

Delete User ID


  1. In PGP Keys, click the key.
  2. Expand the key by clicking the + sign. The expanded key displays two envelopes with a name and email address.
  3. Right-click the first envelope. (This is the original User ID)
  4. Click Delete.
  5. Click OK to complete the process to delete the User ID.

After performing the previous steps, export the key from PGP Desktop and import the key to the PGP Universal Server.