<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 28: UTF-8 bug with newline \n char</title><link>https://sourceforge.net/p/libharu/bugs/28/</link><description>Recent changes to 28: UTF-8 bug with newline \n char</description><atom:link href="https://sourceforge.net/p/libharu/bugs/28/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 15 Feb 2012 09:43:45 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/libharu/bugs/28/feed.rss" rel="self" type="application/rss+xml"/><item><title>UTF-8 bug with newline \n char</title><link>https://sourceforge.net/p/libharu/bugs/28/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I'm building a pdf with libharu, with UTF-8 encoding.&lt;/p&gt;
&lt;p&gt;HPDF_UseUTFEncodings(pdf);&lt;/p&gt;
&lt;p&gt;NSString *path = [[NSBundle mainBundle] pathForResource: @"DejaVuSans" ofType: @"ttf"]; &lt;br /&gt;
const char *fontname = HPDF_LoadTTFontFromFile(pdf, [path UTF8String], HPDF_TRUE); &lt;/p&gt;
&lt;p&gt;HPDF_Font fontEnUTF  = HPDF_GetFont(pdf, fontname, "UTF-8");&lt;br /&gt;
HPDF_Page_SetFontAndSize(page3, fontEnUTF, 10.0);&lt;/p&gt;
&lt;p&gt;const char* cString = [[itemsArray objectAtIndex:i] cStringUsingEncoding:NSUTF8StringEncoding];&lt;/p&gt;
&lt;p&gt;HPDF_UINT charCount = 0;&lt;br /&gt;
HPDF_Page_TextRect(page3, 50.0, K_PORTRAIT_HEIGHT, HPDF_Page_GetWidth(page3)-52, 52.0, cString, HPDF_TALIGN_LEFT, &amp;amp;charCount);&lt;/p&gt;
&lt;p&gt;Everything is fine, except that it wrongly encode \n char. See here output attached.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Beny Boariu</dc:creator><pubDate>Wed, 15 Feb 2012 09:43:45 -0000</pubDate><guid>https://sourceforge.net8181c3e2f52624e02fcd4d07086d8a9f8b598e45</guid></item></channel></rss>