From 324f58eb706ced917b8d8c11fdab79ca0ac08a09 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 20 May 2009 23:03:33 -0400 Subject: [PATCH] very subtle bug in unicodification --- htmlminimizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htmlminimizer.py b/htmlminimizer.py index ea50947..5b18919 100644 --- a/htmlminimizer.py +++ b/htmlminimizer.py @@ -6,7 +6,7 @@ input_file = sys.argv[1] output_file = sys.argv[2] in_pre = False out = open(output_file, 'w', encoding="utf-8") # encoding argument! important! -for line in open(input_file).readlines(): +for line in open(input_file, encoding="utf-8").readlines(): # replace entities with Unicode characters for e in re.findall('&(.+?);', line): if e in ('lt', 'gt', 'amp', 'quot', 'apos', 'nbsp'):