07-02-2010, 02:25 PM
|
#1 (permalink)
|
|
The Contributor
Join Date: Feb 2010
Posts: 69
Thanks: 16
|
stupid encodings -.-
Ok.. so i have been trying to convert Encodings and failed. Yes i know, but every time i try it well.. it fails. Clearly i am doing something wrong so i need a lil help :P.
PHP Code:
<?php
$myFile = "includes/docs/quotepend.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
function fixEncoding($theData)
{
$cur_encoding = mb_detect_encoding($theData) ;
if($cur_encoding == "UTF-8" && mb_check_encoding($theData,"UTF-8"))
return $theData;
else
return utf8_encode($theData);
} // fixEncoding
echo '<div class="HASHLISTPHP">' . $theData . '</div>';
That is what i have in my coding. Its simple its just a page reading a text file... but the encoding is still coming out all spoony E.G. -Ŧķ-κıℓℓεя turns in to -Ŧķ-κı????εя when read on the page lol.
That is a convert script i got from an example on a site so i dont know if thats correct or if its just the script is in the wrong place.
Thanks
|
|
|
|