Using the standard library JSON to serialize structures, strange spaces may appear when Chinese characters appear. #71637
Labels
BugReport
Issues describing a possible bug in the Go implementation.
Go version
go version go1.23.5 windows/386
Output of
go env
in your module/workspace:What did you do?
type ApiRequest struct {
Model string
json:"model"
Messages []Message
json:"messages"
Temperature float64
json:"temperature"
ResponseFormat struct {
Type string
json:"type"
}
json:"response_format"
}
type Message struct {
Role string
json:"role:"
Content string
json:"content"
}
What did you see happen?
console out :

{"model":"deepseek-ai/DeepSeek-R1-Distill-Llama-8B","messages":[{"role:":"user","content":"你好,你在干什么。"}],"temperature":1.3,"r esponse_format":{"type":"text"}}
What did you expect to see?
Better handling of Chinese
The text was updated successfully, but these errors were encountered: