hi there,
i'm having some issues trying to read a file with zero-padded text.
using mb_detect_encoding() it returned that the encoding scheme was UTF-8.
i'm not exactly a unicode expert, so this has pretty much been trial and error for me for the past few days.
i've set up a page and return text so it will display in a drupal page "test/unicode"
$items['test/unicode'] = array(
'title' => t('Unicode test'),
'description' => t('Unicode test'),
'page callback' => 'unicode_test',
'access arguments' => array('add content'),
'type' => MENU_CALLBACK,
);
the function unicode_test() simply returns some text which i am attempting to display from a file containing unicode.
function unicode_test() {
ob_start();
// Bad file
$content = file_get_contents('C:\Documents and Settings\twig\Desktop\blah.vmg');
// This displays: UTF-8
drupal_set_message("content encoding = " . mb_detect_encoding($content));
// This displays: r�e�j�e�c�t�e�d� �t���c�k�e�t�
echo $content;
// This is some test code to remove the zero-padding and turns it into normal ASCII text.
// It works fine, unless the text contains some accented characters (such as the downward accented ' ì ' U+0236 in ticket), which halts my php script and causes weird issues.