Forum Moderators: coopster

Message Too Old, No Replies

s0o0m0e 0t0e0x0t0 0h0e0r0e0 -- text file read/encoding problems

I'm reading from a text file but all my lines come up with little boxes

         

benlieb

5:47 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



I'm trying to read from a text file, but the encoding is getting screwed up. Little boxes occur after every letter . I've tried to paste the offending strings into here but they won't come out. They look like this (kinda), where 0 represents a little square box:

"s0o0m0e 0t0e0x0t0 0h0e0r0e0"

In fact, when I try to even highlight them, they won't highlight properly.

I'm sure this is an unix/mac/ibm encoding thing, but I can't get it to come out right even after opening in "rb" read/binary, and cutting and pasting into various text editing programs.

The text looks normal in my text editors (word, wordpad, notepad, dreamweaver, etc...).

HELPPPPPPPP!

jezra

6:50 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



It sounds like the file may be encoded with the utf-8 character set and the second byte is showing up as the ascii null character when the text is displayed. you may want to try utf8_decode() [us3.php.net] to convert your text to single byte characters. Hope this helps.