Closed kecrily closed 2 years ago
Hi @kecrily!
I'm not familiar with CJK. How should it be encoded?
By default the generated XML specifies utf-8
.
The browser incorrectly uses GBK (a Chinese encoding) to parse the Chinese content, which uses UTF-8, so it is garbled.
By default the generated XML specifies utf-8.
Yes, but the browser does use GBK. I'm not sure why the browser automatically uses GBK to parse it.
Did you try adding the site to feedly and see if the content is parsed as expected?
I have no problem opening feed.atom
directly from the absolute address. But when I open it through pnpm preview
server, the encoding is wrong.
I'm guessing it's a Vite problem.
Did you try adding the site to feedly and see if the content is parsed as expected?
Everything is fine.
Gotcha, seems like it could be related to the headers (or lack of headers) provided to the browser by the Vite preview server.
It wouldn't affect the final result in production. Closing this one for now, but perhaps you can search in the Vite issue tracker to see if anyone has run into something similar in the past.
iles
andvite
.Description π
Provide a clear and concise description of what the bug is.
The CJK content in the feed file generated is incorrectly encoded. It opens locally without problems, but looks like a bunch of mess in the web
Reproduction π
Please provide a link to a repo that can reproduce the problem you ran into.
Write something CJK content, like
δ½ ε₯½δΈη
, then runpnpm build
Dependencies Info
_Run `npx iles info` and `pnpm list` (or `npm list`) and provide the output:_ ``` devDependencies: @iconify/json 2.1.10 @vueuse/core 7.7.0 @islands/feed 0.1.2 dayjs 1.10.8 @islands/icons 0.1.1 iles 0.7.32 @islands/prism 0.1.1 typescript 4.6.2 @unocss/preset-typography 0.26.4 unocss 0.26.4 @unocss/transformer-directives 0.26.4 vue-tsc 0.32.1 ```Logs π
If not providing a reproduction:
Output
_Run `DEBUG=iles:* npm run dev` or `DEBUG=iles:* npm run build` and provide the output:_ ``` ```Screenshots π·
Provide console or browser screenshots of the problem.