欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mochiweb返回结果指定UTF-8编码

程序员文章站 2022-07-15 22:01:56
...
 
201     Form = mochiweb_request:parse_qs(Req),  %% 获取GET请求的参数
202     Server = get_bin(proplists:get_value("server", Form, "wx.com")),
203     [Version, Desc] = odbc_upload_apk:get_version(Server),
204     ?DEBUG("~p:~p Desc=~p", [?MODULE, ?LINE, Desc]),
214     Req:ok({_ContentType = "text/plain;charset=utf-8", [], <<Version/binary,  <<"\n">>/binary, Desc/binary>>});    //返回结果指定UTF-8编码