MarkLogic fails to start with Initialization: XDMP-ENCODING: (err:XQST0087) Unsupported character encoding: ascii
31 March 2021 11:06 AM
MarkLogic may fail to start, with an XDMP-ENCODING error, Initialization: XDMP-ENCODING: (err:XQST0087) Unsupported character encoding: ascii. This is caused by a mismatch in the Linux Locale character set, and the UTF-8 character set required by MarkLogic.
There are two primary causes to this error. The first is using service instead of systemctl to start MarkLogic on some Linux distros. The second is related to the Linux language settings.
Starting MarkLogic Service
On an Azure MarkLogic VM, as well as some more recent Linux distros, you must use systemctl, and not service to start MarkLogic. To start the service, use the following command:
Linux Language Settings
This issue occurs when the Linux Locale LANG setting is not set to UTF-8. This can be accomplished by changing the value of LC_ALL to "en_US.UTF-8". This should be done for the root user for default installations of MarkLogic. To change the system wide locale settings, the /etc/locale.conf needs to be modified. This can be done using the localectl command.
If MarkLogic is configured to run as a non-root user, then setting the locale can be done in the users environment. Setting the value can be done using the $HOME/.i18n file. If the file does not exist, please create it and ensure it has the following:
If that does not resolve the issue in the user environment, then you may need to look at setting LC_CTYPE, or LC_ALL for the locale.