--- tclBinary.c
+++ tclBinary.c
@@ -871,25 +871,21 @@
 		arg++;
 
 		if (count == BINARY_ALL) {
 		    count = listc;
 		} else if (count > listc) {
-		    Tcl_AppendResult(interp,
-			    "number of elements in list does not match count",
-			    NULL);
-		    return TCL_ERROR;
+		    errorString = "number of elements in list does not match count";
+		    goto error;
 		}
 	    }
 	    offset += count*size;
 	    break;
 
 	case 'x':
 	    if (count == BINARY_ALL) {
-		Tcl_AppendResult(interp,
-			"cannot use \"*\" in format string with \"x\"",
-			NULL);
-		return TCL_ERROR;
+		errorString = "cannot use \"*\" in format string with \"x\"";
+		goto error;
 	    } else if (count == BINARY_NOCOUNT) {
 		count = 1;
 	    }
 	    offset += count;
 	    break;
@@ -1195,13 +1191,19 @@
     }
     Tcl_SetObjResult(interp, resultPtr);
     return TCL_OK;
 
  badValue:
-    Tcl_ResetResult(interp);
-    Tcl_AppendResult(interp, "expected ", errorString,
-	" string but got \"", errorValue, "\" instead", NULL);
+    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+	    "expected %s string but got \"%s\" instead",
+	    errorString, errorValue));
+    return TCL_ERROR;
+
+ badField:
+    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+	    "bad field specifier \"%c\"",
+	    *errorString));
     return TCL_ERROR;
 
  badCount:
     errorString = "missing count for \"@\" field specifier";
     goto error;
@@ -1208,23 +1210,12 @@
 
  badIndex:
     errorString = "not enough arguments for all format specifiers";
     goto error;
 
- badField:
-    {
-	Tcl_UniChar ch;
-	char buf[TCL_UTF_MAX + 1];
-
-	Tcl_UtfToUniChar(errorString, &ch);
-	buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
-	Tcl_AppendResult(interp, "bad field specifier \"", buf, "\"", NULL);
-	return TCL_ERROR;
-    }
-
  error:
-    Tcl_AppendResult(interp, errorString, NULL);
+    Tcl_SetObjResult(interp, Tcl_NewStringObj(errorString, -1));
     return TCL_ERROR;
 }
 
 /*
  *----------------------------------------------------------------------
@@ -1569,31 +1560,26 @@
     Tcl_SetObjResult(interp, Tcl_NewLongObj(arg - 3));
     DeleteScanNumberCache(numberCachePtr);
 
     return TCL_OK;
 
+ badField:
+    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+	    "bad field specifier \"%c\"",
+	    *errorString));
+    return TCL_ERROR;
+
  badCount:
     errorString = "missing count for \"@\" field specifier";
     goto error;
 
  badIndex:
     errorString = "not enough arguments for all format specifiers";
     goto error;
 
- badField:
-    {
-	Tcl_UniChar ch;
-	char buf[TCL_UTF_MAX + 1];
-
-	Tcl_UtfToUniChar(errorString, &ch);
-	buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
-	Tcl_AppendResult(interp, "bad field specifier \"", buf, "\"", NULL);
-	return TCL_ERROR;
-    }
-
  error:
-    Tcl_AppendResult(interp, errorString, NULL);
+    Tcl_SetObjResult(interp, Tcl_NewStringObj(errorString, -1));
     return TCL_ERROR;
 }
 
 /*
  *----------------------------------------------------------------------

