Event Calendar lost first symbol from title in Russian language

I am using Elgg 2.3.10 and Event Calendar plugin 2.3.2, but if I'tried to enter the Title in Cyrillic language the first symbol looks damaged. But not any Cyrillic symbol I've found only one which cause the error.

 https://www.awesomescreenshot.com/image/3821615/fb0273f64dee368d1c84d8666777021a

 

  • @RvR, @iionly thank you for support!

    Sure the webhoster cause the problem. I've tried work from Android smartphone and different PC and also get this error.  

    I've managed to convert all tables and columns charsets in database to Utf8mb4. Thanks to this   

    Changed .my.cnf 

    I cannot to restart MySQL server - the webhoster did not provide permission for that.

    Tried several PHP versions from 5.6 to 7.2 all had the default_charset=UTF-8 in php.ini

    Unfortunately the error still the same. Continue crawling.

     

      

  • Continue crawling.

    It will be useless until you restart your MySQL or reboot the server.

  • Possibly I found the simple solution as I cannot to change my webhoster right now.

    I've created the simple table at the Elgg database and send directly the problem symbol.

    And received an Error - such as in the Elgg was - the symbols corrupted.

    Then I add the script which set the charset for the connection to UTF the problem is gone.

    Now I wanted to try this with the Elgg connection but I can not found the way how to did this.

    This is the Results screenshot https://goo.gl/DKbmHV

    The script was for mysqli connections

    <?php
    $servername = "localhost";
    $database = "dfdfd";
    $username = "afsdfsd";
    $password = "sdfdasfas";
    
    // Create connection
    
    $conn = mysqli_connect($servername, $username, $password, $database);
    
    // Check connection
    
    if (!$conn) {
          die("Connection failed: " . mysqli_connect_error());
    }
    .
    echo "Connected successfully";
    
    printf("Source charset: %s\n", $conn->character_set_name());
    
    /* changing the charset to  utf8  - AFTER THIS STRING THE DATAS BECOME CORRECT*/
    if (!$conn->set_charset("utf8")) {
        printf("Error setting charset to  utf8: %s\n", $conn->error);
        exit();
    } else {
        printf("The current charset: %s\n", $conn->character_set_name());
    }
    
    $sql = "INSERT INTO Students (name, lastname, email) VALUES ('ВиталикИ', 'Andy', 'andy@andy.com')";
    if (mysqli_query($conn, $sql)) {
          echo "New record created successfully";
    } else {
          echo "Error: " . $sql . "<br>" . mysqli_error($conn);
    }
    mysqli_close($conn);
    
    ?>
    
     
  • Hopefully I found the solution!

    The error was from the wrong client encoding for MySql and our passing to PDO the param "charset=utf8mb4" ignored

    As was mentioned  here by Joachim

    Hi, Not sure what it's return either. I know how to set the variable, but I have read many places that the charset='' is ignored, and that $db->exec( "SET NAMES 'utf8'"); should be used instead. – Joachim

    https://stackoverflow.com/questions/10552528/pdo-equivalent-of-mysql-client-encoding

    So this hack correct my encoding throughout the system. Possibly there is more pretty way to change the library.

    The file located here

    /docs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php

     

    **
     * PDO MySql driver.
     *
     * @since 2.0
     */
    class Driver extends AbstractMySQLDriver
    {
        /**
         * {@inheritdoc}
         */
        public function connect(array $params, $username = null, $password = null, array $driverOptions = a
        {
            try {
                $conn = new PDOConnection(
                    $this->constructPdoDsn($params),
                    $username,
                    $password,
                    $driverOptions
                );
             //Setting the default client charset just4fun
                $conn->exec( "SET NAMES 'utf8mb4'");
    
            } catch (PDOException $e) {
                throw DBALException::driverException($this, $e);
            }
    
            return $conn;
        }

     

     

     

  • Thanks @RvR @iionly for your concern!

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.