I read few answers on SO but didn't find the answer for this, is it possible to set ANSI endocing for binary data in php. I'm reading images using curl and echo them to the user, but they are saved as UTF-8, and images are not displayd. When I save it as a file on the server (using fopen fwrite) and open that file everything is ok, the same as if I change encoding to ANSI in Notepad++. Right now I'm testing this on windows but it shouldwork on Unix/Linux machines too. Is it possible to do this in php? This is related to my other question How to display binary data from curl in php which I didn't find solution to.
I try to use mb_detect_encoding
function to use with iconv
but it don't return anything on localhost where I test it.
I don't know if it need to be Windows-1252 or not, it work on the server which I think should not send different data to different browsers.