1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 19:10:54 +00:00

Merge pull request #3171 from whomm/master

debug stringsToJSON
This commit is contained in:
astaxie 2018-06-23 22:50:11 +08:00 committed by GitHub
commit 67d9241abc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -350,6 +350,11 @@ func stringsToJSON(str string) string {
jsons.WriteRune(r) jsons.WriteRune(r)
} else { } else {
jsons.WriteString("\\u") jsons.WriteString("\\u")
if rint < 0x100 {
jsons.WriteString("00")
} else if rint < 0x1000 {
jsons.WriteString("0")
}
jsons.WriteString(strconv.FormatInt(int64(rint), 16)) jsons.WriteString(strconv.FormatInt(int64(rint), 16))
} }
} }