Announcement

#1 2021-11-20 15:11:24

ebaque
Member
2021-11-16
5

Error with special characters

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

 

#2 2021-11-20 17:08:54

erAck
Only trying to help
2015-09-06
1340

Re: Error with special characters

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

Code:

$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.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-11-20 21:58:42

ebaque
Member
2021-11-16
5

Re: Error with special characters

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

 

#4 2021-11-21 00:09:25

erAck
Only trying to help
2015-09-06
1340

Re: Error with special characters

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.


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2021-11-21 08:36:34

ebaque
Member
2021-11-16
5

Re: Error with special characters

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

 

#6 2021-11-21 11:55:51

erAck
Only trying to help
2015-09-06
1340

Re: Error with special characters

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.


Running Piwigo at https://erack.net/gallery/

Offline

 

#7 2021-11-21 12:02:08

ebaque
Member
2021-11-16
5

Re: Error with special characters

Perfect, everything clear and working properly.

Thanks a lot.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact