Open applmak opened 7 years ago
https://software.hixie.ch/utilities/cgi/unicode-decoder/utf8-decoder tells me that the strange sequence 0xefbfbd is a result of the first byte of the png being incorrectly interpreted as UTF-8 (0x89) which translates to
U+FFFD REPLACEMENT CHARACTER
* used to replace an incoming character whose value is unknown or unrepresentable in Unicode
* compare the use of 001A as a control character to indicate the substitute function
The second issue is then a problem is phantomjs. I'll file an issue there and link it here.
Filed ariya/phantomjs#14936 for the encoding issue. Still, the harness needs to be updated.
There are two issues here, I guess. One is that the harness does not read the file in binary mode. A fix merely passes 'b' to fs.read when we are serving up a binary file.
The other issue is weirder. When serving a sample png file, the file is changed in some weird way. Specifically:
Even weirder:
which seems to indicate some kind of encoding issue? This problem might be an issue with phantomjs itself.