TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-02-2010, 02:25 PM   #1 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default 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
Tim Dobson is offline  
Reply With Quote
Old 07-04-2010, 08:23 AM   #2 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default

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..
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Old 07-05-2010, 03:25 PM   #3 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default

Quote:
Originally Posted by maeltar View Post
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
Tim Dobson is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid OOP question tego10122 General 8 03-17-2009 03:45 PM
Here's a stupid one... delayedinsanity General 2 05-30-2008 01:59 AM
stupid simple question bmathers Absolute Beginners 11 02-19-2008 07:49 PM
This stupid str_replace bug? Nor General 2 02-06-2008 05:49 PM


All times are GMT. The time now is 11:47 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design