I use PHP Simple DOM to grab a URL. When I print the urls content to screen, I get:
you’ll
instead of:
you'll
If I run
$str = utf8_decode('you’ll');
echo $str;
I get:
you?ll
I’m obviously not understanding the fundamentals of encoding. Can you someone please tell me what I’m missing?
Try to set the encoding to UTF-8 before do anything.
Start your php file with this:
and try to echo/print it without utf8_decode.
Note:
If you’re using mysql (postgesql), use this too:
Edit: also, make sure you save your PHP file in UTF-8 (without BOM) format.