Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | media_gallery-filename_title_utf8_support-1880058-2.patch | 1.26 KB | Moloc |
media-gallery-accents.patch | 1.31 KB | SeeSchloss |
Comments
Comment #1
Moloc CreditAttribution: Moloc commentedFixed regex typo.
Note: after regex is executed, ucwords is used. ucwords is not able to capitalize utf8 characters. Therefore á will not be transformed to Á.
Comment #2
Moloc CreditAttribution: Moloc commentedComment #3
Chris CharltonI'd suggest using the Transliteration module, then all files uploaded will be fixed.
Comment #4
ivnish CreditAttribution: ivnish commented