Characters appear as question marks using MySQL

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

Certain characters (Cyrillic or Japanese, for example) appear as question marks "????" even though encoding has already been set to UTF-8 in Confluence, MySQL and the app server. Running the encoding test returns successfully with the supplied testing string (Iñtërnâtiônàlizætiøn).

Diagnosis

Run the following:

SHOW VARIABLES LIKE 'character\_set\_%';

Which should return a result set like:

+--------------------------+--------+
| Variable_name            | Value
+--------------------------+--------+
| character_set_client     | latin1
| character_set_connection | latin1
| character_set_database   | utf8
| character_set_filesystem | binary
| character_set_results    | latin1
| character_set_server     | latin1
| character_set_system     | utf8
+--------------------------+--------+
7 rows in set (0.00 sec)

Cause

The default encoding for inbound connections isn't set properly. DEFAULT CHARSET will return as utf8 however character_set_server will be something different. In the above example, the character_set_server was set as latin1.

Resolution

Set default-character-set=utf8, as detailed in Configuring Database Character Encoding.

Please also review the character set and collation settings at the databasetable, and column levels as described in this KB: How to Fix the collation and character set of a MySQL Database

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.