From e96ae0c24a101efb29eeb0f6d0ec4c0bb8a15673 Mon Sep 17 00:00:00 2001 From: whomm Date: Mon, 21 May 2018 15:18:18 +0800 Subject: [PATCH] debug stringsToJSON json char: \u four-hex-digits number(http://json.org/) --- context/output.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/context/output.go b/context/output.go index 61ce8cc7..4bf135fd 100644 --- a/context/output.go +++ b/context/output.go @@ -350,6 +350,11 @@ func stringsToJSON(str string) string { jsons.WriteRune(r) } else { jsons.WriteString("\\u") + if rint < 0x100 { + jsons.WriteString("00") + } else if rint < 0x1000 { + jsons.WriteString("0") + } jsons.WriteString(strconv.FormatInt(int64(rint), 16)) } }