After wkhtmltopdf saves the web page to pdf, there is an error if saving as a file name using a character like''

Save the web page with wkhtmltopdf. When the file name contains a character like"", it will report an error when it is run in the shell of win10.

for example, my code is:

pdfkit.from_url("https://www.google.com",".pdf")

the following error occurs when running in the shell of win10

OSError: wkhtmltopdf reported an error:
Loading pages (1/6)
QPainter::begin(): Returned false============================] 100%
Error: Unable to write to destination
Exit with code 1, due to unknown error.

but there is no problem in MacOS. Why?

Aug.27,2021

I guess it is the coding problem of windows itself. You can set the encoding to utf8, before saving, or try gbk,. If not, don't save the special characters

.
Menu