Converting UTF8 Data to SQL_ASCII I want to convert my query results from a database, which is SQL_ASCII database encoded, to UTF-8.

$result = $query-&gt;execute;
$converted_data = array();
foreach($result as $record){
    $converted_data[count($converted_data)] = drupal_convert_to_utf8($record-&gt;name, 'sql-ascii');
}


I used drupal_convert_to_utf8 but it returns blank all the time. I was confused if sql-ascii should be the second parameter of drupal_convert_to_utf8. The database encoding, where the query results is fetched, is SQL_ASCII in postgres.

UPDATE:

According to the official documentation, It


  Requires the iconv, GNU recode or mbstring PHP extension.


What are they? Am I going to install/include it or what?
Go to /admin/reports/status and take a look at your unicode library. If you don't have multibyte support, install it: http://php.net/manual/en/mbstring.installation.php

I.e. for ubuntu like systems it's sudo apt-get install php7.0-mbstring for PHP7.

EDIT:

You could try 'auto' instead of 'sql_ascii', and btw., you can skip the count() call and can just write $converted_data[] = drupal_...

END EDIT