Closed ZacJW closed 1 year ago
Hi, I am going to fix this with a naive patch #77. See if this is suitable for your case. Thanks.
The situation become better after #77 but still not good to blindly guess that all contents defaults to UTF-8. I'll keep this issue to track the integration of charset detection library, such as chardetng. Charset detection may introduce extra I/O on the content, so we need to be careful. Follow how Firefox integrates chardetng may be a good start.
Besides, sfz doesnot leverage hyper Body stream and instead it read all content into memory (as #33 described). This lack might also affect how charset detection would look like in sfz. We'd better address this as well if possible.
I understand charset detection isn't ideal yet, but I had that same issue and #77 did fix it. Could a new version of the crate be published with this fix before the new charset detection stuff is worked in?
Hi, @fasterthanlime. Just release 0.6.2. Thanks for your suggestion!
Thank you for the PR. Unfortunately I have no time working on it. See #108.
I've just started using sfz 0.6.1 for some WebAssembly development and I've noticed some odd behaviour.
When I request a
.wasm
file, sfz responds withcontent-type: application/wasm; charset=utf-8
but this isn't a utf-8 encoded file, it's a binary format. As a result when I try to load the WebAssembly in Firefox 92, it complains about the MIME type not being as expected and having to fallback to a slower instantiation method as a result.Here's a
curl -v
with sfz serving the fileFor extra context, here's a
curl -v
withpython3 -m http.server
serving the file, which does not produce the error