Skip to content

echo 渲染 json string 等出现乱码 - Use utf-8 encoding for bind and render API #131

Closed
@panjunjie

Description

@panjunjie

echo 渲染 json string html 等出现乱码,比如:
c.String(http.StatusOK, "你好,世界!\n")
c.Json(http.StatusOK, map[string]interface{}{"name":"中文"})
等方法均出现乱码。是不是 c.response.Header() 需要指定编码,如 utf-8;

另外,获取中文参数 c.Query("title") 也应该会出现以上乱码问题。

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions