I have a problem with encoding polish characters in PoDoFo library.
This code generates invalid encoding of word 'Łódź'
#include <podofo/podofo.h>
using namespace PoDoFo;
int main(int argc, char *argv[], char *env[]) {
PdfStreamedDocument document("polish.pdf");
PdfPainter painter;
PdfPage* pPage;
pPage = document.CreatePage( PdfPage::CreateStandardPageSize( ePdfPageSize_A4 ) );
painter.SetPage( pPage );
PdfFont* pFont = document.CreateFont("Helvetica");
// PdfFont* pFont = document.CreateFont("Helvetica", new PdfIdentityEncoding(0, 0xffff, true) );
PdfString pString("Polish word: Łódź");
// PdfString pString(reinterpret_cast<const pdf_utf8*>("Polish word: Łódź"));
painter.SetFont( pFont );
painter.DrawText( 100.0, pPage->GetPageSize().GetHeight()-100.0, pString );
painter.FinishPage();
document.Close();
return 0;
}
In output pdf there is
Polish word: ņÃ3dÅo
I've tried to change encoding of source string (using commented lines in sample code), but all failed.
Can somebody explain me how to create PDF document containing non-ascii characters using PoDoFo library?