How to set unicode words in csv file

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
mayur.pimple's picture

Hi

If i want to write "lietotājvārds tête " this word in csv file. but can not show this word in csv in unicode format.

how to display unicode in csv.

My Code is :

ob_clean();
ob_start();

drupal_set_header("Content-type: text/csv; charset=utf-8");
drupal_set_header("Content-Disposition: attachment; filename=".$fname);


print  mb_convert_encoding('lietotājvārds tête', 'UTF-16LE', 'UTF-8'); echo '","';

ob_flush();
die();