[horde] utf8 is not supported by MySQL

Ralf Lang ralf.lang at ralf-lang.de
Wed Aug 17 07:10:45 UTC 2022


Am 16.08.2022 um 23:11 schrieb Ralf Lang:
>
> Hi,
>
> Am 16.08.22 um 21:14 schrieb Mike Gabriel:
>> Hi,
>>
>> On  Di 26 Jul 2022 17:45:00 CEST, Arjen de Korte wrote:
>>
>>> Citeren Ferdinand Gruber <fer.grub at yahoo.de>:
>>>
>>>> I get this message utf8 is not supported by MySQL after login to my 
>>>> horde site.
>>>>
>>>> This message appears after I upgraded from openSUSE 15.3 to 15.4.
>>>>
>>>> I suspect it has something to do with the database version
>>>>
>>>> In Suse 15.3 the MariaDB version was 10.6.16
>>>> In Suse 15.4 the MariaDB version is 10.6.7
>>>>
>>>> I think this might be the reason of the error.
>>>>
>>>> What can I do?
>>>
>>> Change
>>>
>>>    $conf['sql']['charset'] = 'utf8';
>>>
>>> to
>>>
>>>    $conf['sql']['charset'] = 'utf8mb3';
>>>
>>> in your 'horde/config/conf.php' file.
>>
>>
>> Or apply this (partial) patch to Horde_Db:
>> https://salsa.debian.org/horde-team/php-horde-db/-/blob/debian-sid/debian/patches/1012_php8.1.patch#L487 
>>
>>
>> (where I default to utf8mb4)
>>
> I am strictly and strongly in the utf8mb4 camp. utf8mb3 has proven to 
> be unsuitable for modern calendaring.
>
> https://www.ralf-lang.de/2022/08/15/maintaina-horde-utf-8-on-php-8/
>
> https://www.ralf-lang.de/2021/01/27/davx5-caldav-may-break-with-unicode-symbols-in-horde-kronolith-syncs/
>
> That said, the issue is a bit larger. The encoding config is read and 
> used verbatim in places where you don't expect it - and depending on 
> which extension is handling your character conversions (iconv, 
> mbstring) and which PHP version is run on which OS version, you can 
> run into trouble.
>
> https://lists.horde.org/archives/dev/Week-of-Mon-20220801/029567.html
>
> PHP 8 mbstring does no longer silently tolerate/ignore encoding names 
> it does not understand
>
> https://www.php.net/manual/en/function.mb-convert-encoding.php
>
>
>
> 8.0.0 	*mb_convert_encoding()* will now throw a ValueError 
> <https://www.php.net/manual/en/class.valueerror.php> when 
> |to_encoding| is passed an invalid encoding.
> 8.0.0 	*mb_convert_encoding()* will now throw a ValueError 
> <https://www.php.net/manual/en/class.valueerror.php> when 
> |from_encoding| is passed an invalid encoding.
>
>
> I've been looking for an appropriate place to put a reusable 
> lookup/conversion between db-specific encoding names and official 
> encoding names. My first hotfix went against the horde/share library 
> but this is not appropriate in the longer term.
>
> https://github.com/maintaina-com/Share/commit/cb1db22efb480cd371c30aa5f22fd1383b28fb15
>
The prefs store is the next item that breaks in PHP 8.1+ if you encode 
as "utf8mb4" - However works fine in PHP 7.4.
I will do the needed work...



More information about the horde mailing list