# From: Jordan Metzmeier <jmetzmeier01@gmail.com>
# Subject: Use codecs.open for reading files so utf-8 is properly
# handled in both python2 and 3
--- a/crontab.py
+++ b/crontab.py
@@ -90,6 +90,7 @@
 import os
 import re
 import sys
+import codecs
 
 import tempfile
 import subprocess as sp
@@ -229,7 +230,7 @@
             lines = self.intab.split('\n')
         elif filename:
             self.filen = filename
-            with open(filename, 'r') as fhl:
+            with codecs.open(filename, 'r', encoding='utf-8') as fhl:
                 lines = fhl.readlines()
         else:
             (out, err) = pipeOpen(CRONCMD, l='', u=self.user).communicate()
