[horde] utf8 is not supported by MySQL

Simon Wilson simon at simonandkate.net
Fri Oct 28 14:51:47 UTC 2022


----- Message from Ralf Lang <ralf.lang at ralf-lang.de> ---------
    Date: Tue, 16 Aug 2022 23:11:05 +0200
    From: Ralf Lang <ralf.lang at ralf-lang.de>
Subject: Re: [horde] utf8 is not supported by MySQL
      To: horde at lists.horde.org, fer.grub at yahoo.de


> 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


----- End message from Ralf Lang <ralf.lang at ralf-lang.de> -----

I just ran into this on a RHEL8 server running Horde with MySql  
8.0.30-1 (official RH packages) on PHP 7.4.32.

Resolved (temporarily?) by setting Horde conf.php to utf8mb4 instead  
of utf8... but looking at the emails in this thread, are there other  
actions needed, is a patch in dev? Or I'm fine as is?

Simon



-- 
Simon Wilson
M: 0400 12 11 16



More information about the horde mailing list