-
I use marp-vscode. When I tried to generate a PDF from an iso88591/latin1-encoded file, garbage characters appeared in the exported file. It used UTF-8 instead. VSCode probably allows plugin to query file encoding, so I think this can be solved. At first, I thought it was a bug on marp-vscode. But then I searched for a related feature on marp-core and marp-cli and couldn't find anything. Doesn't marp allow choosing charset? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently Marp assumes the encoding for each input as UTF-8. A classic Marp app had been detected charset of Markdown automatically, but there were a lot of reports about misdetection. (yhatt/marp#86) VS Code extension will export by using a temporarily file that is converted to UTF-8 when exporting a dirty Markdown (There is unsaved changes). In this case, PDF will be exported correctly even if Markdown is not having UTF-8 charset. So VS Code extension probably can fix it by updating the condition for using the temporarily file. |
Beta Was this translation helpful? Give feedback.
Currently Marp assumes the encoding for each input as UTF-8. A classic Marp app had been detected charset of Markdown automatically, but there were a lot of reports about misdetection. (yhatt/marp#86)
VS Code extension will export by using a temporarily file that is converted to UTF-8 when exporting a dirty Markdown (There is unsaved changes). In this case, PDF will be exported correctly even if Markdown is not having UTF-8 charset. So VS Code extension probably can fix it by updating the condition for using the temporarily file.
https://github.com/marp-team/marp-vscode/blob/bc09bd5241c28889ec077a7820992599a0e307cd/src/marp-cli.ts#L30