deepPHP Posted May 30, 2013 Share Posted May 30, 2013 hi there, I've tried to read a hebrew web page in diffrent of ways such as CURL, SOCKTES, file_get_content, readfile. i've also tried to add an aproperiate header(content-type: text/html; charset=unicode). i opended a Sniffer program and sent the exactly headers that the browser sends to that specific website and it doesnt work. thank you! Quote Link to comment https://forums.phpfreaks.com/topic/278587-tryin-read-a-unicode-web-page/ Share on other sites More sharing options...
requinix Posted May 30, 2013 Share Posted May 30, 2013 Define "doesn't work". Because the character encoding won't affect you getting the content, only when you try to do something with it. Quote Link to comment https://forums.phpfreaks.com/topic/278587-tryin-read-a-unicode-web-page/#findComment-1433246 Share on other sites More sharing options...
deepPHP Posted May 31, 2013 Author Share Posted May 31, 2013 i'm getting the data in the right way, but the encoding sucks it's messed up all the page's content to unreadable data. do you get me? Quote Link to comment https://forums.phpfreaks.com/topic/278587-tryin-read-a-unicode-web-page/#findComment-1433372 Share on other sites More sharing options...
DaveyK Posted May 31, 2013 Share Posted May 31, 2013 is the page that displays the retrieved data UTF-8 (unicode) ? Otherwise, set it to UTf-8 in the php header() function and a HTML meta tag. Also, if you are storing that data also make sure that the connection to the database AND the database itself is unicode as well. Quote Link to comment https://forums.phpfreaks.com/topic/278587-tryin-read-a-unicode-web-page/#findComment-1433375 Share on other sites More sharing options...
requinix Posted May 31, 2013 Share Posted May 31, 2013 Then whatever you're doing to "read" it is incorrect. You're getting the right data the right way, but reading it the wrong way. Post some code. Quote Link to comment https://forums.phpfreaks.com/topic/278587-tryin-read-a-unicode-web-page/#findComment-1433377 Share on other sites More sharing options...
deepPHP Posted May 31, 2013 Author Share Posted May 31, 2013 Nevermind, I got it work!I used iconv to convert windows-1255 to utf-8. iconv("windows-1255","UTF-8",$ch); thank you anyway Quote Link to comment https://forums.phpfreaks.com/topic/278587-tryin-read-a-unicode-web-page/#findComment-1433395 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.