X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpdf-scheme.cc;h=61cf382e6b45e21955f87d34df57609fc39b48a7;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=79cc21a5d5013b3becd58ff3f1db1e69a74dcce3;hpb=cb0b407e567feca71cbc5f9479a06b266c69a26c;p=lilypond.git diff --git a/lily/pdf-scheme.cc b/lily/pdf-scheme.cc index 79cc21a5d5..61cf382e6b 100644 --- a/lily/pdf-scheme.cc +++ b/lily/pdf-scheme.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "international.hh" #include "warn.hh" @@ -83,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; }