Bug 1052342 - ttname doesn't support unicode
Summary: ttname doesn't support unicode
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ttname
Version: 23
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Nils Philippsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1138703 1191107 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-13 16:48 UTC by Paul Flo Williams
Modified: 2015-11-14 01:53 UTC (History)
5 users (show)

Fixed In Version: ttname-1-6.fc23 ttname-1-6.fc21 ttname-1-6.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-13 22:55:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Paul Flo Williams 2014-01-13 16:48:04 UTC
Description of problem:

ttname produces an exception while reading a name record from the Macintosh strings when the name string contains a copyright symbol (U+00A9).

Version-Release number of selected component (if applicable):

ttname-1-2.fc20.noarch

How reproducible:

Always

Steps to Reproduce:
1. Install Open Sans (simplest example)
2. ttname -a /usr/share/fonts/open-sans/OpenSans-Semibold.ttf

Actual results:

Macintosh (#1)/Roman (#0)/English (#0)
======================================
Traceback (most recent call last):
  File "/usr/bin/ttname", line 9, in <module>
    load_entry_point('ttname==1', 'console_scripts', 'ttname')()
  File "/usr/lib/python2.7/site-packages/ttname/cli.py", line 48, in __init__
    self.read()
  File "/usr/lib/python2.7/site-packages/ttname/cli.py", line 179, in read
    print '{0}: {1}'.format(info.name(n), n.string)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 25: ordinal not in range(128)

Expected results:

List of name records.

Additional info:

Open Sans is quite unusual in having a copyright symbol in the copyright name record, rather than a stand-in like '(c)'. The Macintosh Roman coding is an 8-bit coding that has the copyright sign at 0xA9, the same location as in Unicode, but ttname apparently believes that only ASCII characters can be present in this string.

Comment 1 T.C. Hollingsworth 2014-01-14 23:09:01 UTC
Yeah this doesn't handle Unicode at all at the moment.  *hangs head in shame*

I fixed outputting records with unicode chars upstream last night:
https://github.com/tchollingsworth/ttname/commit/0a352b9a3b6aeb558e3cd4d2939a24321dd7b0dc

Handling input is a little trickier thanks to Python 2's warty unicode support in the stdlib.  I'm fairly sure I've got it working right locally but I'm super busy today so I'd rather wait until later this week when I can test it better (and expand the test suite to cover it).  The current situation of bombing out with an exception is definitely better than me pushing something half-arsed that may potentially silently corrupt files.  :-p

Thanks for the report!

Comment 2 Fedora End Of Life 2015-05-29 10:29:04 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2015-06-30 00:50:55 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 Nils Philippsen 2015-11-04 14:41:14 UTC
*** Bug 1138703 has been marked as a duplicate of this bug. ***

Comment 5 Nils Philippsen 2015-11-04 14:41:16 UTC
*** Bug 1191107 has been marked as a duplicate of this bug. ***

Comment 6 Fedora Update System 2015-11-04 16:59:14 UTC
ttname-1-6.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-56e9cda570

Comment 7 Fedora Update System 2015-11-04 16:59:15 UTC
ttname-1-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-6b19539c8d

Comment 8 Fedora Update System 2015-11-04 16:59:29 UTC
ttname-1-6.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-007a0a9677

Comment 9 Fedora Update System 2015-11-05 00:22:44 UTC
ttname-1-6.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update ttname'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-007a0a9677

Comment 10 Fedora Update System 2015-11-05 01:27:40 UTC
ttname-1-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update ttname'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-6b19539c8d

Comment 11 Fedora Update System 2015-11-05 15:52:33 UTC
ttname-1-6.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update ttname'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-56e9cda570

Comment 12 Fedora Update System 2015-11-13 22:55:05 UTC
ttname-1-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2015-11-14 01:51:19 UTC
ttname-1-6.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2015-11-14 01:52:52 UTC
ttname-1-6.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.