-1

Possible Duplicate:
UTF-8 all the way through

Either by using file_get_contents() or curl functions, output is wrong, to be specific, east-european č and ć latin characters is always replaced by nasty characters, šđž sometimes, depends if I'm trying something with changing internal encoding of PHP - it only get worse.

Yes, I've read similar topics, but with following these instructions, things get worse.

Does anyone have solution? Thanks in advance.

Community
  • 1
  • 1
greenV
  • 311
  • 3
  • 7
  • 1
    The problem is with *displaying* the data, not with reading it. Stop reading "instructions" and devote some time to learning about text encodings. – Jon Oct 24 '12 at 08:26
  • 1
    Sorry, but this is *way* too hazy to give any kind of meaningful answer. You'll have to add much more detail. I have a link that may help you though – Pekka Oct 24 '12 at 08:26
  • @Jon actually, it is problem with reading, as I think... I've tried file_put_contents with retrived data, problem remains – greenV Oct 24 '12 at 08:37
  • [What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text](http://kunststube.net/encoding/) – deceze Oct 24 '12 at 09:01
  • @deceze,thanks, that article looks like serious tut. – greenV Oct 24 '12 at 10:03
  • use this in beginning of the script `header('Content-Type: text/html; charset=utf-8');` – Sohail Ahmed Oct 24 '12 at 10:04

1 Answers1

0

It's likely that you try to display the data with wrong encoding, if the data your accessing with file_get_contents/curl is a remote html page, read the Content-Type from header or tag and convert the encoding using iconv

ninaj
  • 748
  • 4
  • 9