mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:00:55 +00:00
debug stringsToJSON
json char: \u four-hex-digits number(http://json.org/)
This commit is contained in:
parent
f16688817a
commit
e96ae0c24a
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user