Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • hormigacapoeira

    (@hormigacapoeira)

    You might get warnings when you activate permalinks after replacing chars for html entities. Disabling warnings on wp-config fixed that issue

    @ini_set('log_errors','On');
    @ini_set('display_errors','Off');
    @ini_set('error_log','/home/example.com/logs/php_error.log');
    /* That's all, stop editing! Happy blogging. */
    hormigacapoeira

    (@hormigacapoeira)

    Found a solution :

    replace all spanish chars to entities on your db and then /wp-admin/upgrade.php.

    <?php
    
    $file = file_get_contents('db_old.sql');
    
    $file = handleSpanishCharacters($file);
    
    $result = file_put_contents("db_modified.sql", $file);
    if (!$result) {
      echo 'no se ha podido generar el archivo';
    }else{
      echo 'se ha generado el archivo portado exitosamente';
    }
    
    function handleSpanishCharacters($input){
    
        $translate = array();
        $translate['á'] = "Á";
        $translate['é'] = "É";
        $translate['í'] = "Í";
        $translate['ó'] = "Ó";
        $translate['ú'] = "Ú";
        $translate['?'] = "Ñ";
        $translate['ü'] = "Ü";
        $translate['á'] = "á";
        $translate['é'] = "í";
        $translate['í'] = "é";
        $translate['ó'] = "ó";
        $translate['ú'] = "ú";
        $translate['?'] = "ñ";
        $translate['ü'] = "ü";
        $translate['?'] = "¿";
        $translate['?'] = "¡";
        $translate['?'] = "«";
        $translate['?'] = "»";
        $translate['€'] = "€";
    
        $search = array_keys($translate);
    
        $replace = array_values($translate);
    
        return str_replace($search,$replace,$input);
    
    }
    
    ?>
    hormigacapoeira

    (@hormigacapoeira)

    upgrading from 2.6.2 to 2.9.2

    on database all words were cutted off at the firts spanish char .

    examples : ‘María’ ended up ‘Mar’, ‘cantarán’ ended up ‘cantar’

    db charsert is utf8

    I have backed up 2.6.2 db that has a lot of entries.

    any suggestion on how to get my db upgraded keeping the spanish chars ?

Viewing 3 replies - 1 through 3 (of 3 total)