Charset problem
See original GitHub issue const puppeteerBrowser = await puppeteer.launch({ args: ['--no-sandbox'] })
const puppeteerPage = await puppeteerBrowser.newPage()
await puppeteerPage.setContent(html, { waitUntil: 'networkidle0' })
const pdfstring = await puppeteerPage.pdf({
displayHeaderFooter: false,
printBackground: true,
format: 'A3'
})
res.setHeader('Content-disposition', `attachment; filename=${page}.pdf`);
res.setHeader('Content-type', 'aplication/pdf');
res.end(pdfstring)
await puppeteerBrowser.close()
If i generate PDF using code above, than wrong charset is used. In html code is specificly added meta tag <meta charset="utf-8"/>
and I can`t find any option in puppeteer to specify otherwise.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Solving character encoding problems - jAlbum Wiki
Problem. Computers store text as a sequence of numbers where each character has a unique number according to an agreed upon "character encoding...
Read more >The character set problem - Hostpoint Support Center
This error is the easiest to correct. The data is stored and output with a consistently defined charset, but the charset being used...
Read more >Charset (character encoding) problem: text is displayed ...
Non-Latin characters in commit messages or file contents are displayed as squares or unknown characters.
Read more >How to fix character encoding issue in html? - Stack Overflow
1 Answer 1 · On Notepad++ select Encoding -> ISO-8859-15 and save the file. · Use <meta http-equiv="Content-Type" content="text/html; charset=ISO- ...
Read more >Fix Character Encoding on Your Website - Larry Kagan
A step-by-step guide to troubleshooting and repairing character encoding problems in your website.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Duplicated issue mate, close it please. https://github.com/GoogleChrome/puppeteer/issues/4424
See https://github.com/GoogleChrome/puppeteer/issues/4424#issuecomment-492196710. For the time being, installing the previous version (v1.15.0) does seem to resolve the issue.