From ad278d69447ddca9c6923e5e830c12f1329438b9 Mon Sep 17 00:00:00 2001 From: Zhaozhong Ni Date: Tue, 8 May 2018 17:23:06 -0700 Subject: state: serialize string as bytes instead of protobuf string. Protobuf strings have to be UTF-8 encoded or 7-bit ASCII. PiperOrigin-RevId: 195902557 Change-Id: I9800afd47ecfa6615e28a2cce7f2532f04f10763 --- pkg/state/printer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/state/printer.go') diff --git a/pkg/state/printer.go b/pkg/state/printer.go index c61ec4a26..881125ddd 100644 --- a/pkg/state/printer.go +++ b/pkg/state/printer.go @@ -30,7 +30,7 @@ func format(graph uint64, depth int, object *pb.Object, html bool) (string, bool case *pb.Object_BoolValue: return fmt.Sprintf("%t", x.BoolValue), x.BoolValue != false case *pb.Object_StringValue: - return fmt.Sprintf("\"%s\"", x.StringValue), x.StringValue != "" + return fmt.Sprintf("\"%s\"", string(x.StringValue)), len(x.StringValue) != 0 case *pb.Object_Int64Value: return fmt.Sprintf("%d", x.Int64Value), x.Int64Value != 0 case *pb.Object_Uint64Value: -- cgit v1.2.3