I'm saving XML files from a remote server. If the filename on the remote server doesn't have special characters (čšćđž) then the file saves fine and i can read it. But if the filename on the remove server has special characters (for example: lorem_ipsum_čž.xml) then it saves as an empty XML. The filename in both cases get's saved with proper name like the one from the remote server.
If i manually download the remote file it's ok, so i'm guessing it must be something in either file_get_contents or file_put_contents than i'm missing. I've checked the SO Q/A and searched the web about this but without a solution.
$source_url = file_get_contents('http://example.com');
file_put_contents($saved_file, $source_url);