How to Identify Invalid Characters on a Confluence Page
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Purpose
Sometimes we are not able to save pages in Confluence due to an error like "Unable to communicate with the server. Saving is not possible at the moment". However, we cannot identify the cause by reviewing the page in view mode or by checking the draft when opening the editor.
This how-to guide is aimed to help on identifying invalid characters that may prevent the page from being saved. Those characters can be carried over when we copy contents from web pages and they can be invisible to the editor.
Solution
In order to proceed with the troubleshooting steps, we need to install the Source Editor plugin:
With the Source plugin, we can review and edit the XHTML code that will be saved on Confluence database. That is the only way to view invalid characters and identify them if they are not visible on the normal editor.
Here are the steps to test if the page has invalid characters:
- Open the page in edit mode to get the contents of the draft
- Grab the storage format (click on the *<>* button in the upper right corner of the screen)
- Create a fresh page and try to apply the copied storage format
- If any problem is detected on the XML, the source editor will warn us pointing to the problematic line
Here is an example of a problematic XML code:
<td colspan="1">"� Automatic payments: On. You will be automatically charged on the due date. <u>Update preferences</u>."</td>
If you try to save this, you will get:
The encoded sequence "�" is the code for the "?" character. This format is usually applied to emojis or special characters which are not valid to XML language, hence the error when trying to save the page in Confluence. Once we remove that sequence, we can successfully save the page.