diff --git a/meshio/h5m_io.py b/meshio/h5m_io.py
index <HASH>..<HASH> 100644
--- a/meshio/h5m_io.py
+++ b/meshio/h5m_io.py
@@ -209,9 +209,9 @@ def write(
     tstt.create_dataset(
         'history',
         data=[
-         __name__.encode('utf8'),
-         __about__.__version__.encode('utf8'),
-         str(datetime.now()).encode('utf8')
+         __name__.encode('utf-8'),
+         __about__.__version__.encode('utf-8'),
+         str(datetime.now()).encode('utf-8')
         ]
         )
 
diff --git a/meshio/off_io.py b/meshio/off_io.py
index <HASH>..<HASH> 100644
--- a/meshio/off_io.py
+++ b/meshio/off_io.py
@@ -116,7 +116,7 @@ def write(
 
         # counts
         c = '%d %d %d\n\n' % (len(points), len(tri), 0)
-        fh.write(c.encode('utf8'))
+        fh.write(c.encode('utf-8'))
 
         # vertices
         fmt = '%%.%de' % dtype_digits(points.dtype)
utf8 -> utf-8