Table of Contents

Troubleshooting Character Encoding Issues

As of Ampache 3.4-Beta2 Character Encoding is strictly enforced. Previous versions of Ampache used a best effort approach, unfortunately that resulted in invalid XML and display issues. The default Encoding for Ampache is UTF-8.

Non-Latin characters do not appear correctly in the web interface

This can be caused by many different things. Below is a quick checklist to go through when you are having trouble with non-ASCII characters.

Verifying your currently defined character encoding

Linux Linux uses the locale collection of utilities.

locale 

Should show you your current settings

locale -a

Should return a list of all installed locales

Windows

The default charset for most US windows installs is Windows-1252 or CP1252. It is recommended that you set ampache to use this charset.

Resetting your Database Charset

You can reset all references to the charset on your database through the Ampache interface. Go to the Admin tab and then select Ampache Debug and then click Set Database Charset. Ampache will run through your entire database and make sure that the charset listed on the database, tables and fields matches your site_charset. You may need to run verify after performing this function as it does not attempt to convert. It only sets.

Ampache Utilities

Ampache provides some additional tools to help you cope with Character set mis-matches. These scripts must be run from the command line. After making any changes to your tags or the filenames please make sure you update your catalog and that your local client has the character set and fonts required to display the tag information.

php ./bin/fix_filenames.inc

This script looks through the path of your local catalogs for filenames who contain characters that do not exist in the currently configured site_charset. It will prompt you for a source character charset, if none is specified it will use the current output_encoding value from iconv().

You can also look at the raw tags inside a file by running the included print_tags.inc file. This example takes advantage of the hexcat application to get the hex values of the output. You will need to compare the reported HEX value to the HEX value according to the defined charset.

php ./bin/print_tags.inc [FILE] > my.output
hexcat my.output