TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   stupid encodings -.- (http://www.talkphp.com/absolute-beginners/5462-stupid-encodings.html)

Tim Dobson 07-02-2010 02:25 PM

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($fhfilesize($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

maeltar 07-04-2010 08:23 AM

Hmmmm... can you attach the file or put a link to it so I can have a fight with it, looks like clan names to me, and people tend to use funky name generators that use all sorts of char sets..

Tim Dobson 07-05-2010 03:25 PM

Quote:

Originally Posted by maeltar (Post 30741)
Hmmmm... can you attach the file or put a link to it so I can have a fight with it, looks like clan names to me, and people tend to use funky name generators that use all sorts of char sets..

LOL fixed it... it apeard i forgot to drop the meta tag in :-/ my bad ^^


All times are GMT. The time now is 09:55 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0