X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpdf-scheme.cc;h=61cf382e6b45e21955f87d34df57609fc39b48a7;hb=a6a51abfd0195a3cf7d6ea095cf69808852f21ce;hp=2c8605639108eac4cdb1b1da75e969ef272d43e5;hpb=c39d188d28fdc84cef8cbaea7b8d6e2fb718c30f;p=lilypond.git diff --git a/lily/pdf-scheme.cc b/lily/pdf-scheme.cc index 2c86056391..61cf382e6b 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--2014 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 @@ -84,14 +84,16 @@ LY_DEFINE (ly_encode_string_for_pdf, "ly:encode-string-for-pdf", free (p); /* Convert back to SCM object and return it */ - /* FIXME guile-2.0: With guile 2.0 the internal representation of a string - * has changed (char vector rather than binary bytes in - * UTF-8). However, with guile 2.0, ly:encode-string-for-pdf - * is no longer needed and can be replaced by the new - * (string->utf16 str 'big) - */ if (g) - return scm_take_str (g, bytes_written); // scm_take_str eventually frees g! + { + /* + * Return the raw byte representation of the UTF-16BE encoded string, + * in a locale independent way. + */ + SCM string = scm_from_latin1_stringn (g, bytes_written); + free(g); + return string; + } else return str; }