Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

luismabenitez's avatar

iconv(): Wrong charset in DOMPDF

Getting the next error on with DomPDF using Lambda (Vapor)

iconv(): Wrong charset, conversion from utf-8' to us-ascii//TRANSLIT' is not allowed

It does work perfectly on local, but can't find any doc related about this error.

I'm using docker with Laravel Vapor and PHP 7.4 on ->stream()

0 likes
3 replies
siangboon's avatar

I guess the issue may because DomPDF using "us-ascii" and your "utf-8"... try to play around at the meta tag...

"<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
zhafariirsyad's avatar

hi, I also have the same problem, is there a solution? I've tried the method above but it doesn't work when I try it in production/staging

Please or to participate in this conversation.