Menu

#5130 Fix the encoding of the PDF metadata when using guile-2.0

Verified
Enhancement
2017-05-11
2017-05-01
No

Fix the encoding of the PDF metadata when using guile-2.0

Postscript files are encoded in Latin1, but PDF metadata has to be
encoded in UTF-16BE.

ly:encode-string-for-pdf takes care of that but it was not working
properly with guile-2.0 because the internal representation of strings
in guile-2.0 has changed and the actual destination encoding has to be
specified explicitly, especially when it's different from the current
locale.

Passing the encoded metadata as Latin1 corresponds to pass its raw byte
representation, and this is enough to make things work.

This also gets rid of a misleading warning:
"`scm_take_str' is deprecated. Use scm_take_locale_stringn instead."

This change is compatible with guile-1.8 so the FIXME comment in
lily/pdf-scheme.cc has been removed. A note was added to
scm/framework-ps.scm to suggest a possible implementation in scheme of
ly_encode_for_pdf(), just in case of a possible future cleanup.

http://codereview.appspot.com/322930043

Discussion

  • Anonymous

    Anonymous - 2017-05-01
    • Description has changed:

    Diff:

    
    
    • Needs: -->
    • Patch: new --> review
     
  • Anonymous

    Anonymous - 2017-05-01

    Passes make, make check and a full make doc.

     
  • Anonymous

    Anonymous - 2017-05-03
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2017-05-03

    Patch on countdown for May 6th.

     
  • Anonymous

    Anonymous - 2017-05-06
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2017-05-06

    Patch counted down - please push. - see previous note from Antonio.

     
  • Thomas Morley

    Thomas Morley - 2017-05-06
    • labels: --> Fixed_2_19_60
    • status: Started --> Fixed
    • Patch: push -->
     
  • Thomas Morley

    Thomas Morley - 2017-05-06

    pushed to staging as:

    commit db449e3935bc8b765979e1d4a4ab3018908cbbd8
    Author: Antonio Ospite ao2@ao2.it
    Date: Sat Nov 19 15:27:15 2016 +0100

    Issue 5130 Fix the encoding of the PDF metadata when using guile-2.0
    
    Postscript files are encoded in Latin1, but PDF metadata has to be
    encoded in UTF-16BE.
    
    ly:encode-string-for-pdf takes care of that but it was not working
    properly with guile-2.0 because the internal representation of strings
    in guile-2.0 has changed and the actual destination encoding has to be
    specified explicitly, especially when it's different from the current
    locale.
    
    Passing the encoded metadata as Latin1 corresponds to pass its raw byte
    representation, and this is enough to make things work.
    
    This also gets rid of a misleading warning:
      "`scm_take_str' is deprecated. Use scm_take_locale_stringn instead."
    
    This change is compatible with guile-1.8 so the FIXME comment in
    lily/pdf-scheme.cc has been removed. A note was added to
    scm/framework-ps.scm to suggest a possible implementation in scheme of
    ly_encode_for_pdf(), just in case of a possible future cleanup.
    
     
  • Antonio Ospite

    Antonio Ospite - 2017-05-06

    Thanks Thomas, I was asking just because I didn't see my name on https://codereview.appspot.com/322930043

    I also appreciate that you are mentioning my name in the commit message for the patches that I started but then left unfinished.

    Ciao ciao,
    Antonio

     
  • Federico Bruni

    Federico Bruni - 2017-05-11
    • status: Fixed --> Verified
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.