WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Encoding bug

Open NicolasFR opened this issue 1 year ago • 2 comments

Hello,

I have a problem encoding accented letters on alpine that I don't encounter on Ubuntu. However, if I force the encoding to UTF-8, I have no more problems.

Do you have an idea about how to approach this issue ?

NicolasFR avatar Apr 01 '24 18:04 NicolasFR

Hi!

Default encoding for web documents is Latin-1, not UTF-8. When you render a document from the web, HTTP gives WeasyPrint hints about the encoding, so it’ll work even if it’s UTF-8. But if you render a document from the disk, there’s no HTTP hint, it’ll use the default Latin-1 encoding.

If you want to force WeasyPrint to use UTF-8, then use the --encoding parameter, or set a charset meta tag in your HTML file.

liZe avatar Apr 02 '24 14:04 liZe

Is there anything more we can do for you?

liZe avatar Apr 09 '24 13:04 liZe

Feel free to reopen if needed.

grewn0uille avatar May 10 '24 15:05 grewn0uille

Thank you for your reply, which really helped me with my troubleshooting session. No need to reopen it.

NicolasFR avatar May 29 '24 20:05 NicolasFR