nametable-from-filename: encode string correctly
@@ -211,7 +211,7 @@ def swap_name(field, font_name_field, new_name):
'''Replace a font's name field with a new name'''
enc = font_name_field.getName(*field).getEncoding()
text = str(font_name_field.getName(*field)).decode(enc)
- text = new_name
+ text = new_name.encode(enc)
font_name_field.setName(text, *field)
