diff --git a/lec2/letters.py b/lec2/letters.py
index 22f445c8e866cb37eb083520bc151d6c0f295ad3..5cc87931ac5608f69066f6e9b88e79cca77f7542 100755
--- a/lec2/letters.py
+++ b/lec2/letters.py
@@ -10,7 +10,7 @@ def file2prob(filename):
     letter_dict  = { c: 0 for c in letters }
     letter_total = 0
 
-    with open(filename) as fp:
+    with open(filename, encoding="utf-8") as fp:
         for c in fp.read():
             if c.lower() not in letter_dict:
                 continue
@@ -30,7 +30,7 @@ def file2pairs(filename):
     letter_dict  = { c: { a: 0 for a in letters }
                      for c in letters }
     previous = None
-    with open(filename) as fp:
+    with open(filename, encdoing="utf-8") as fp:
         for c in fp.read():
             if c not in letter_dict:
                 continue