Bad foreign strings from text file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kaspari22
Forum Newbie
Posts: 2
Joined: Fri Jun 27, 2008 6:00 am

Bad foreign strings from text file

Post by kaspari22 »

Hello,
my question is how can I show exact strings when I'm reading text file to one column on page...

In html header is:
[text]<meta http-equiv="Content-Type" content="text/html; charset=utf-8">[/text]

Php code for shoving text is:

Code: Select all

<?
        $data = File ("ansii_text.txt");
        for ($i = 0; $i < Count ($data); $i++)
        echo "$data[$i]<br>";
        ?>
Text file is saved in format FTP_ANSII... right strings should be something like "ěščřů" but they are mismatched.
I tried stream_encoding to change encoding but it didn't help..

How can I get visible exactly what is written in TXT file? ...have a same page encoding or recode saved format of text file?

Anyone can help me?
User avatar
kaspari22
Forum Newbie
Posts: 2
Joined: Fri Jun 27, 2008 6:00 am

Re: Bad foreign strings from text file

Post by kaspari22 »

Finally solution can be switch global charset from UTF-8 to WINDOWS-1250. After are strings posted from forms visible exactly how they are.... :)
Post Reply