Skip to content

Python importOutlines can't handle unicode #3058

@pelson

Description

@pelson

I'm on Python 2 (also tested on 3), OSX, FontForge 20161012. (same setup as #3057)

Importing an outline from a filename that is itself unicode fails. The easy workaround is to rename the file, but it would be nice to have unicode support for filenames (some filesystems support it, after-all).

The code to reproduce:

$ cat unicode_import.py 

# -*- coding: utf-8 -*-

import fontforge

font = fontforge.font()
font.encoding = "UnicodeFull"

filename_with_unicode = 'cake_🎂.svg'

c = font.createMappedChar(ord('A'))
c.importOutlines(filename_with_unicode)
$ python unicode_import.py 

Traceback (most recent call last):
  File "unicode_import.py", line 11, in <module>
    c.importOutlines(filename_with_unicode)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 5: ordinal not in range(128)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions