Skip to content

Commit 866204c

Browse files
committed
add utf-8 to file reading, re: #23
1 parent 0b454de commit 866204c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/dlig2calt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ def simpleDlig2calt(fontPath, inplace=False):
2727
ttxPath = fontPath.replace(".ttf",".ttx")
2828

2929
# Read in the TTX file
30-
with open(ttxPath, 'r') as file:
30+
with open(ttxPath, 'r', encoding='utf-8') as file:
3131
ttxData = file.read()
3232

3333
# Replace the target string to update the dlig feature tags to calt feature tags
3434
ttxData = ttxData.replace('"dlig"', '"calt"')
3535

3636
# Write the TTX file out again
37-
with open(ttxPath, 'w') as file:
37+
with open(ttxPath, 'w', encoding='utf-8') as file:
3838
file.write(ttxData)
3939

4040
# merge TTX back into font:

0 commit comments

Comments
 (0)