Menu

#13 Properly encode placename tags

Unknown
open
5
2008-01-14
2007-10-31
No

Some place names have non-standard characters in them, which should be properly quoted when writing them to Exif/IPTC.
Lars Hagström solved this problem by using unicode() instead of str() in v1-beta1, but this is not applicable anymore for the current SVN-version.

Discussion

  • Pieter Edelman

    Pieter Edelman - 2007-11-02
    • milestone: --> 625138
     
  • Pieter Edelman

    Pieter Edelman - 2007-11-02

    Logged In: YES
    user_id=35584
    Originator: YES

    Should be resolved in v1-beta2

     
  • Pieter Edelman

    Pieter Edelman - 2007-11-03

    Logged In: YES
    user_id=35584
    Originator: YES

    This issue is actually quite complicated. The IPTC standard specifies that multiple encodings can be used, however, this is implemented poorly. Just putting something in Unicode works on some software, but fails on other. See for a discussion http://libiptcdata.sourceforge.net/docs/iptc-i18n.html

    A possible solution might be to let the user decide; if she wants Unicode, make it so, if not, replace extended characters by a different character.

    One note: if Happy Camel starts writing Unicode characters, it needs to convert all relevant tags to Unicode.

     
  • Pieter Edelman

    Pieter Edelman - 2007-11-03

    Logged In: YES
    user_id=35584
    Originator: YES

    Bug #866500 (http://sourceforge.net/tracker/index.php?func=detail&aid=1791258&group_id=173711&atid=866500) is a dupe containing a patch.

     
  • Pieter Edelman

    Pieter Edelman - 2007-11-03

    Logged In: YES
    user_id=35584
    Originator: YES

    A straightforwarded solution to this problem wou;d be to use UTF-8 encoding, since all normal charcters stay normal, only the special characters would occupy more than one octet. So in most cases, the software doesn't even have to cope with the encoding.
    Still, there are some potential problems. We can't just set the coding to UTF-8. If we find some freak image which has a non-standard encoding for its IPTC data, we do need to convert it. Also, there's still a problem that software can't cope with it, JBrout for example.

    This feature can be enable by using:
    place["place"].encode("utf-8")
    instead of:
    place["place"].encode("ascii", "replace")
    in the queruGeoNames method of photohandler.PhotoList,

    and when writing images adding:
    self.tbp_image.setIPTCTag("CodedCharacterSet", '\x1b\x25\x47')
    and:
    exiftool_cl += " -IPTC:CodedCharacterSet=UTF8 "

     
  • Pieter Edelman

    Pieter Edelman - 2008-01-14

    Logged In: YES
    user_id=35584
    Originator: YES

    So far, there's no proper solution in sight, so we can't really set a milestone.

     
  • Pieter Edelman

    Pieter Edelman - 2008-01-14
    • milestone: 625138 --> Unknown
     

Log in to post a comment.