0

I have some files on a server with non-ASCII names and when I'm browswing the apache-generated index of a directory, the non-ASCII characters are not recognized (shown as ?).

I've added instructions in the .htaccess files :

IndexOptions Charset=UTF-8

I've set the default charset in apache2 conf file :

AddDefaultCharset UTF-8

and in my directory clause, I have :

AllowOverride AuthConfig Indexes

and it's still not working, any other suggestions ?

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972

1 Answers1

0

Are you sure the filenames on your server are encoded as UTF-8?

If you have older files and live in europe (as I) it is very likely your filenames are encoded in ISO8859-1 (sometimes also called latin-1) or ISO8859-15. Debian (and so Ubuntu) used to contain a package called:

utf8-migration-tool 

which contains a wizard like utility to convert filenames.
This tool is written in scripting language Python. It contains a module named:

/usr/share/utf8-migration-tool/pylib/wizard/steps.py

which in turn contains a class called

FileNameConversion

Unfortunately this class will need to be refactored to be usefull to manipulate filenames in a certain part of your filesystem. May be you want change your Apache configuration to ISO8859-1 for a short test first?

pefu
  • 679
  • 1
  • 6
  • 24