By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,446 Members | 1,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,446 IT Pros & Developers. It's quick & easy.

characters are read wrong?

P: n/a
hi all,

I use $lijst = file('lijst.txt'); to read the file 'lijst.txt' line by
line. When I echo $lijst some chracters are changed.

Original file (lijst.txt)
(I'll Never Be) Maria Magdalena - Sandra
(Tell It All About) Boys - Dolly Dots
9 To 5 - Dolly Parton
A Brand New Day - Wiz Stars
A Love Bizarre - Sheila E.
A Walk In The Park - Nick Straker Band
Ain't No Mountain High Enough - Boys Town Gang

array $lijst contains:
(Tell It All About) Boys ‚?" Dolly Dots
9 To 5 ‚?" Dolly Parton
A Brand New Day ‚?" Wiz Stars
A Love Bizarre ‚?" Sheila E.
A Walk In The Park ‚?" Nick Straker Band
Ain‚?Tt No Mountain High Enough ‚?" Boys Town Gang

the -, and ' characters are changed. Someone knwos why this is and what can
be done?

Regards
Stijn
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Stijn Goris <me*****@hotmail.com> wrote:
[orignal]
Ain't No Mountain High Enough - Boys Town Gang
[file()] Ain??Tt No Mountain High Enough ??" Boys Town Gang

the -, and ' characters are changed. Someone knwos why this is and what can
be done?


How are you testing this? First line is plain old ASCII, second one
looks like UTF-8 displayed as iso8859-1.

Does the original actually include simple ' and - characters, or is your
editor playing tricks on you (much like Andy suggested in you explode
question).

Putting both the original file and the php processing it online would
really be helpfull IMHO.

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
On Sat, 9 Oct 2004 15:23:57 +0200, "Stijn Goris" <me*****@hotmail.com> wrote:
I use $lijst = file('lijst.txt'); to read the file 'lijst.txt' line by
line. When I echo $lijst some chracters are changed.

Original file (lijst.txt)
(I'll Never Be) Maria Magdalena - Sandra
(Tell It All About) Boys - Dolly Dots
9 To 5 - Dolly Parton
A Brand New Day - Wiz Stars
A Love Bizarre - Sheila E.
A Walk In The Park - Nick Straker Band
Ain't No Mountain High Enough - Boys Town Gang

array $lijst contains:
(Tell It All About) Boys ‚?" Dolly Dots
9 To 5 ‚?" Dolly Parton
A Brand New Day ‚?" Wiz Stars
A Love Bizarre ‚?" Sheila E.
A Walk In The Park ‚?" Nick Straker Band
Ain‚?Tt No Mountain High Enough ‚?" Boys Town Gang

the -, and ' characters are changed. Someone knwos why this is and what can
be done?


See my reply to your other post - they're almost certainly not - and ',
they're em-dash and left- and right-quotes (a.k.a. "smart quotes"). These don't
exist in the iso8859-1 character set encoding, as commonly used on the web.

In fact, the way they're being converted into three characters looks a lot
like UTF-8, although I've not checked the character values you've posted.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.