Everywhere in the code where data is queried from the LSF database we find uses of the function utf8_encode which recodes from Latin-1 to UTF-8 despite its name. This function is deprecated since PHP 8.2.0, however, we should not be recoding anything manually since the PostgreSQL functions can automatically convert to a desired character encoding by correctly setting the client encoding using pg_set_client_encoding.