PoDoFoライブラリのポーランド語文字のエンコードに問題があります。
このコードは、単語「Łó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;
}
出力pdfには
ポーランド語: ņã3dÅo
ソース文字列のエンコーディングを変更しようとしましたが (サンプル コードのコメント行を使用)、すべて失敗しました。
PoDoFo ライブラリを使用して、ASCII 以外の文字を含む PDF ドキュメントを作成する方法を誰かに説明してもらえますか?