XH 1.6: Cater for Filenames with non ASCII Characters

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

XH 1.6: Cater for Filenames with non ASCII Characters

Post by cmb » Wed May 15, 2013 12:45 pm

Hello Community,

in CMSimple_XH 1.5 filenames (images, downloads etc.) with non ASCII characters cause several problems, when the server's encoding is not UTF-8: those characters are displayed wrongly in the filebrowser, and deleting these files is not possible at all. When uploading such files, they will end up with strange names in the file system.

IMHO that's not a big problem for many languages as transliteration (e.g. replacing ü with ue) can be done by the user. But for languages which don't use latin characters at all, it may well be a problem. A Taiwanese developer made even a fork of CMSimple_XH available, that caters for this issue: https://github.com/chiamingyen/CMSimple-and-plugins/.

So we may consider to convert such filenames with mb_string (at least where available).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Cater for Filenames with non ASCII Characters

Post by cmb » Fri Dec 09, 2016 12:04 pm

Some concrete ideas:
  • There should be a configuration option in the core where a user can specify the character encoding of their file system. The option could be an xenum, filled by mb_list_encodings.
  • There should be a simple API which can also be used by plugins to convert from and to UTF-8. Maybe two functions, XH_convertToFilename() and XH_convertFromFilename(), or so.
  • We may consider adding fallbacks to ext/iconv and maybe ext/recode, if ext/mbstring is not available.
  • We have to cater to the transparent filename conversion on Windows under PHP 7.1
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply