Hello/
Is there an option available to use special characters (Ççàèèìòù ...) in the name of files and in the texts of the images fields (Description, ...)?
Piwigo 12.1.0
Sistema operatiu: WINNT
PHP: 8.0.11
MySQL: 5.5.5-10.4.21-MariaDB [2021-11-20 15:06:52]
Llibreria gràfica: External ImageMagick 7.1.0-14
Thanks!
Offline
If you are using the FTP sync method to add images you need to add the characters to your local config's $conf['sync_chars_regex'] expression using the LocalFiles extension (or editing local/config/config.inc.php directly if you know how), like
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.Ççàèèìòù]+$/';
see also https://github.com/Piwigo/Piwigo/pull/1269/files for caveats.
Using them in descriptions shouldn't be a problem if all your software handles UTF-8 text encoding correctly.
Offline
Thank you very much for your quick response. I have included the sync_chars_regex statement as you have indicated. When synchronizing I keep getting the error:
[./galleries/002.-Carrers_i_llocs/002.-Carrer_de_Dalt/Carrer_de_Dalt_012 - Plaça_de_Església.jpg] PWG-UPDATE-1 (nom de fitxer erroni)
I have included:
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.ÇçàèéíóúÀÈÉÍÓÚüï]+$/';
I do not know what I do badly.
On the other hand, if you could clarify the UTF-8 issue a bit more, since the descriptions of the images are displayed without the local characters. In which sw could the error be, I do not know this topic very well.
Thanks.
Offline
Your filename contains spaces but the regex does not contain a space. Add one.
If those characters are not displayed in descriptions and they are extracted from EXIF or IPTC fields then the software writing those does not do it in UTF-8 encoding (provided the web server is running in UTF-8 environment, which it usually is and the filename seems to display correctly, unless both are equally in a different encoding). As you mentioned WINNT maybe your image editing / tagging software if that's also on Windows uses a dull MS-codepage encoding. If you provided a link to an original problematic image file one could tell whether that is the problem.
Offline
Fantastic! The two things work perfectly. I am very grateful to you, I had been with this for several hours.
The only character that doesn't work is the apostroph '. I understand that it must be more complicated. Is there any solution?
I have tried including it in $ conf ['sync chars regex'], but it gives an error on save local/config/config.inc.php.
Thanks erAck!!
Offline
ebaque wrote:
The only character that doesn't work is the apostroph '. I understand that it must be more complicated. Is there any solution?
No. You cannot use ' apostrophe in names to sync. As lined out in the code comment of the pull request I pointed to earlier.
Offline
Perfect, everything clear and working properly.
Thanks a lot.
Offline