My media "files" are mostly Youtube videos, often with accents in their names.

By default, media_gallery tries to process the filename to make it more readable, but only taking A-Z and 0-9 into account, making accented text less readable than it used to be ("Titanic à la flûte" becoming "Titanic La Fl Te" for example).

Here's a patch that uses Unicode classes instead of ranges like [A-Z].
It shouldn't cause any issue, and the "u" regex modifier exists since PHP 4.3.5 (without any particular extension) so no worries about compatibility.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Moloc’s picture

Fixed regex typo.

Note: after regex is executed, ucwords is used. ucwords is not able to capitalize utf8 characters. Therefore á will not be transformed to Á.

Moloc’s picture

Chris Charlton’s picture

I'd suggest using the Transliteration module, then all files uploaded will be fixed.

ivnish’s picture

Status: Needs review » Closed (outdated)