src/db/pgsql/PostgresConnector.php
private function fixUtf8Encoding($value) {
        $encoding = mb_detect_encoding($value, null, true);
        if ($encoding!='ASCII' && $encoding!='UTF-8')
            $value = utf8_encode($value);
        return $value;
    }
private function fixUtf8Encoding($value) {
        $encoding = mb_detect_encoding($value, null, true);
        if ($encoding!='ASCII' && $encoding!='UTF-8')
            $value = utf8_encode($value);
        return $value;
    }
private function fixUtf8Encoding ( $ value ) { $ encoding = mb_detect_encoding ( $ value , null , true ) ; if ( $ encoding != 'ASCII' && $ encoding != 'UTF-8' ) $ value = utf8_encode ( $ value ) ; return $ value ; }
Fix the encoding of a potentially non-UTF-8 encoded value.

@param string $value - potentially non-UTF-8 encoded value

@return string - UTF-8 encoded value

@see https://www.drupal.org/node/434802
Fix the encoding of a potentially non - UTF - 8 encoded value .