Good luck tracking down the source of the issue.
I actually had another UTF-8 issue come up today with another project
I'm working on. The cause there was a call to htmlentities() which
doesn't support multibyte encodings (like UTF-8). I review the code
that generates the HTML for dompdf and sure enough, there was a call
to htmlentities(). After removing it, everything worked great.
$newstring = htmlentities($oldstring, ENT_QUOTES, "UTF-8");
Now, since I've removed it, is there any change that I'll run into
issues if any specific characters are included that should've been
translated using htmlentities?
I am having the same problem but the discussion thread did not help
me. My code looks like this;
$html .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$html .= '<html xmlns="http://www.w3.org/1999/xhtml">';
$html .= '<head>';
$html .= '<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />';
$html .= '</head>';
$html .= '<body>';
$html .= ' 献给母亲的爱';
$html .= '</body> </html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html, 'UTF-8');
$dompdf->set_paper("a4", "landscape" );
$dompdf->render();
$dompdf->stream("Management_Report.pdf");
Not sure what am i doing wrong here. Any help greatly appreciated !!!
Thank you.
On 3/2/12, BrianS <eclect...@gmail.com> wrote:
> On Friday, March 2, 2012 5:23:24 PM UTC-5, Symetric wrote:
>>
>> I actually had another UTF-8 issue come up today with another project
>> I'm working on. The cause there was a call to htmlentities() which
>> doesn't support multibyte encodings (like UTF-8). I review the code
>> that generates the HTML for dompdf and sure enough, there was a call
>> to htmlentities(). After removing it, everything worked great.
>>
>
> I believe htmlentities() should support UTF-8 just fine so long as you tell
> it you're passing in a string encoded with UTF-8. Try something like the
> following:
>
> $newstring = htmlentities($oldstring, ENT_QUOTES, "UTF-8");
>
>
> Review the docs <http://www.php.net/manual/function.htmlentities.php> on
> this function for more information.
>
>
>> Now, since I've removed it, is there any change that I'll run into
>> issues if any specific characters are included that should've been
>> translated using htmlentities?
>>
>
> So long as your document is correctly encoded and you have specified the
> encoded in the document meta tags you should be fine.
>
> --
> You received this message because you are subscribed to the Google Groups
> "dompdf" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/dompdf/-/Y8Lx1x3KghQJ.
> To post to this group, send email to dom...@googlegroups.com.
> To unsubscribe from this group, send email to
> dompdf+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dompdf?hl=en.
>
>
Hi All,I am having the same problem but the discussion thread did not help
me. My code looks like this;
$html .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$html .= '<html xmlns="http://www.w3.org/1999/xhtml">';
$html .= '<head>';
$html .= '<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />';$html .= '</head>';
$html .= '<body>';
$html .= ' 献给母亲的爱';
$html .= '</body> </html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html, 'UTF-8');
$dompdf->set_paper("a4", "landscape" );
$dompdf->render();
$dompdf->stream("Management_Report.pdf");Not sure what am i doing wrong here. Any help greatly appreciated !!!
Thank you.
--
You received this message because you are subscribed to the Google Groups "dompdf" group.
To view this discussion on the web visit https://groups.google.com/d/msg/dompdf/-/xJ-LrzIEBqIJ.
I hope i can get answer for my previous posting... i am really
desperate here. :)
Thank you
On 3/5/12, Sem Kurtulus <sem.ku...@gmail.com> wrote:
> Hi Brian,
>
> Thank you for your response. I read the documentation you have provided and
> I wanted to clear couple of things on my side.
>
> Our website is in hostmoster and i just got a shell access to execute the
> command for the load_font.php. But I have no idea about the fonts to
> include.
>
> By the way, this is going to be for TURKISH. I am sorry i used japanese as
> a trial, didnt mean to confuse.
>
> So based on my limited understanding of how to load things etc, can you
> please tell me what i need to do from here on?
>
> Thanks again.
>
> Sem
>
> 2012/3/4 BrianS <eclect...@gmail.com>
>
>> On Sunday, March 4, 2012 1:21:35 PM UTC-5, Sem K wrote:
>>>
>>> Hi All,
>>>
>>> I am having the same problem but the discussion thread did not help
>>> me. My code looks like this;
>>>
>>>
>>> $html .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
>>> Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/**DTD/xhtml1-transitional.dtd<http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
>>> ">'**;
>>> $html .= '<html
>>> xmlns="http://www.w3.org/1999/**xhtml<http://www.w3.org/1999/xhtml>
>>> ">';
>>> $html .= '<head>';
>>> $html .= '<meta http-equiv="Content-Type" content="text/html;
>>> charset=UTF-8" />';
>>>
>>> $html .= '</head>';
>>>
>>> $html .= '<body>';
>>>
>>> $html .= ' 献给母亲的爱';
>>>
>>> $html .= '</body> </html>';
>>>
>>> $dompdf = new DOMPDF();
>>> $dompdf->load_html($html, 'UTF-8');
>>> $dompdf->set_paper("a4", "landscape" );
>>> $dompdf->render();
>>> $dompdf->stream("Management_**Report.pdf");
>>>
>>> Not sure what am i doing wrong here. Any help greatly appreciated !!!
>>>
>>> Thank you.
>>>
>> You're doing everything right but for one oversight. You haven't
>> specified
>> a font that supports the characters in your document body. The core fonts
>> do not support CJK and I don't believe that the DejaVu fonts do either.
>> For
>> testing Chinese character text I've used the Firefly Sung font and had
>> not
>> problems.
>>
>> Read the Unicode how-to
>> <http://code.google.com/p/dompdf/wiki/CPDFUnicode>and make sure you use a
>> supporting font (e.g. Firefly
>> Sung <http://cle.linux.org.tw/fonts/FireFly/>). You either need to load
Hi Brian,
Thank you for your response. I read the documentation you have provided and I wanted to clear couple of things on my side.
Our website is in hostmoster and i just got a shell access to execute the command for the load_font.php. But I have no idea about the fonts to include.
By the way, this is going to be for TURKISH. I am sorry i used japanese as a trial, didnt mean to confuse.
So based on my limited understanding of how to load things etc, can you please tell me what i need to do from here on?
Thanks again.
Sem
2012/3/4 BrianSOn Sunday, March 4, 2012 1:21:35 PM UTC-5, Sem K wrote:
Hi All,I am having the same problem but the discussion thread did not help
me. My code looks like this;
$html .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$html .= '<html xmlns="http://www.w3.org/1999/xhtml">';
$html .= '<head>';
$html .= '<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />';$html .= '</head>';
$html .= '<body>';
$html .= ' 献给母亲的爱';
$html .= '</body> </html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html, 'UTF-8');
$dompdf->set_paper("a4", "landscape" );
$dompdf->render();
$dompdf->stream("Management_Report.pdf");Not sure what am i doing wrong here. Any help greatly appreciated !!!
Thank you.