Merge pull request #4751 from jepler/fix-cp1252-build

Fix cp1252 build
This commit is contained in:
Limor "Ladyada" Fried 2021-05-12 10:12:23 -04:00 committed by GitHub
commit fa485aa2bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -419,7 +419,6 @@ def compute_huffman_coding(translations, compression_filename):
print("//", values, lengths)
values = [(atom if len(atom) == 1 else chr(0x80 + words.index(atom))) for atom in values]
print("//", values, lengths)
max_translation_encoded_length = max(
len(translation.encode("utf-8")) for (original, translation) in translations
)

View File

@ -18,7 +18,7 @@ parser.add_argument("--font", type=str, help="Font path", required=True)
parser.add_argument("--extra_characters", type=str, help="Unicode string of extra characters")
parser.add_argument(
"--sample_file",
type=argparse.FileType("r"),
type=argparse.FileType("r", encoding="utf-8"),
help="Text file that includes strings to support.",
)
parser.add_argument("--output_c_file", type=argparse.FileType("w"), required=True)