Sanitizing Query Results Data In my customized module, I have queried a database value, Jocelyn D. Napiñas. It contains ñ that causes my code to break. Is there any way I can display it? I tried the following code.

$data;  //Contains `Jocelyn D. Napiñas`

drupal_convert_to_utf8($data, 'us_ascii'); //Returns false

check_plain($data); //Returns ''


How will I display it as Jocelyn D. Napiñas?
According to drupal_convert_to_utf8 it required Requires the iconv, GNU recode or mbstring PHP extension to work,  make sure mbstring Php extension installed(Go to /admin/reports/status and take a look at your unicode library) if not installed install it and try again 

 drupal_convert_to_utf8($data , 'us-ascii');


if not worked  according to mb convert encoding you can let Php detect encdoing with AUTO, so  use 

drupal_convert_to_utf8($data, 'auto');  


Also  I can suggest another solution for you 

iconv(mb_detect_encoding($data, mb_detect_order(), true), "UTF-8", $data);