From 9844bdebd6720a51d48c5d92f1477fe4ec5c86c2 Mon Sep 17 00:00:00 2001 From: lxsang Date: Sat, 11 Jan 2020 23:50:01 +0100 Subject: [PATCH] fix utf8 pb --- APIs/std.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/APIs/std.lua b/APIs/std.lua index b9efd94..4ff179f 100644 --- a/APIs/std.lua +++ b/APIs/std.lua @@ -38,14 +38,14 @@ function std.cjson(ck) for k,v in pairs(ck) do std.setCookie(k.."="..v.."; Path=/") end - std.header("Content-Type","application/json") + std.header("Content-Type","application/json; charset=utf-8") std.header_flush() end function std.chtml(ck) for k,v in pairs(ck) do std.setCookie(k.."="..v.."; Path=/") end - std.header("Content-Type","text/html") + std.header("Content-Type","text/html; charset=utf-8") std.header_flush() end function std.t(s) @@ -83,16 +83,16 @@ end end ]] function std.html() - std.header("Content-Type","text/html") + std.header("Content-Type","text/html; charset=utf-8") std.header_flush() end function std.text() - std.header("Content-Type","text/plain") + std.header("Content-Type","text/plain; charset=utf-8") std.header_flush() end function std.json() - std.header("Content-Type","application/json") + std.header("Content-Type","application/json; charset=utf-8") std.header_flush() end function std.jpeg()