Fixed UnicodeEncodeError in sprintn and sprint in gen_print.py

Change-Id: I0c28bf409c6fa88b04b665632f3694edda2d91a0
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/gen_print.py b/lib/gen_print.py
index c66e764..3dc1878 100755
--- a/lib/gen_print.py
+++ b/lib/gen_print.py
@@ -1150,7 +1150,10 @@
     buffer                          This will be returned to the caller.
     """
 
-    return str(buffer)
+    try:
+        return str(buffer)
+    except UnicodeEncodeError:
+        return buffer
 
 
 def sprintn(buffer=""):
@@ -1164,7 +1167,10 @@
     buffer                          This will be returned to the caller.
     """
 
-    buffer = str(buffer) + "\n"
+    try:
+        buffer = str(buffer) + "\n"
+    except UnicodeEncodeError:
+        buffer = buffer + "\n"
 
     return buffer