Ivan
Ivan

Reputation: 1851

echo and UTF-8 (PHP)

I have installed Apache on my server (I wasn't using Apache) and special characters started to show wrong.

So I changed every file to UTF-8, configured MySQL to work with UTF-8 and everything worked fine. However, my Python app (which retrieves some information from the website) doesn't work properly.

For example, I had a file "test.php" which returned either 0 or 1. Python code then did whatever with that result.

But now, my Python app doesn't receive "0", I don't know what it gets from the website. I made the app send a GET request to my site with what it was getting and it sent me this: "???0".

What can I do? I tried to change the header to send the result as ISO-8859-1 (as it was before) but isn't working either.

Upvotes: 0

Views: 826

Answers (1)

user680786
user680786

Reputation:

It's BOM symbol. Remove this symbol from script in Notepad++ editor (Menu -> Encoding -> Encode in UTF-8 without BOM).

Upvotes: 1

Related Questions