X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpdf-scheme.cc;h=da2ce2cef3c74b8346ef707eda37d1006111e3c1;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=1801ae286d3fa8e9ae3e02611f9f09b6730eb411;hpb=d61cf3bbdb1c6670a127ba3baddf2f04d3e34fd3;p=lilypond.git diff --git a/lily/pdf-scheme.cc b/lily/pdf-scheme.cc index 1801ae286d..da2ce2cef3 100644 --- a/lily/pdf-scheme.cc +++ b/lily/pdf-scheme.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2011--2012 Reinhold Kainhofer + Copyright (C) 2011--2015 Reinhold Kainhofer LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,10 +36,25 @@ LY_DEFINE (ly_encode_string_for_pdf, "ly:encode-string-for-pdf", char const *charset = "UTF-8"; // Input is ALWAYS UTF-8! gsize bytes_written = 0; +#if 0 + /* First, try to convert to ISO-8859-1 (no encodings required). This will * fail, if the string contains accented characters, so we do not check * for errors. */ g = g_convert (p, -1, "ISO-8859-1", charset, 0, &bytes_written, 0); + +#else + + /* In contrast to the above comment, we do _not_ try full ISO-8859-1 + * since a number of Ghostscript versions fail to properly convert + * this into PDF. UTF-16BE, in contrast, works better with recent + * versions of Ghostscript. + */ + + g = g_convert (p, -1, "ASCII", charset, 0, &bytes_written, 0); + +#endif + /* If that fails, we have to resolve to full UTF-16BE */ if (!g) {