diff --git a/mseedpeek/libtrace.py b/mseedpeek/libtrace.py
index dd91a84f4e2af1472b7353a507f12912089bc327..e8a3f41582b4e40dd6869a445a96012b228c1dc0 100755
--- a/mseedpeek/libtrace.py
+++ b/mseedpeek/libtrace.py
@@ -1418,7 +1418,7 @@ class Mseed(futils):
             tmpchar = ""
             while tmpchar != "~":
                 tupchar = self.sunpack(fmtstr, self.infileread(1))
-                tmpchar = str(tupchar[0])
+                tmpchar = tupchar[0].decode()
                 if tmpchar != "~":
                     char = char + tmpchar
                 length_data_string += 1