sveltejs / sites

Monorepo for the sites in the Svelte ecosystem
https://svelte.dev
MIT License
291 stars 124 forks source link

The repl download messes with encodings #103

Open burningTyger opened 5 years ago

burningTyger commented 5 years ago

Describe the bug Typing some umlauts such as äöü in the REPL's App.svelte and downloading it will mess up the umlauts to gibberish

To Reproduce https://svelte.dev/repl/cefce44e52ee42a79123e6c23d108b54?version=3 Download, build and start to see the text

Expected behavior öäü can be used and don't need to be fixed afterwards via encoding conversions

This looks correct: image

This is what it really looks like when downloaded: image

Conduitry commented 3 years ago

Running all strings through TextEncoding before passing them to do-not-zip seems reasonable. I was also considering whether do-not-zip ought to do some encoding itself, but I'm still torn as to whether I'd consider that in its purview. Simpler would be to just handle this in the Svelte site. I'd be happy to accept a PR to this effect. The file to change would be site/src/routes/repl/[id]/_components/AppControls/index.svelte.