close

資料來源Google App Engine 設定 UTF-8 輸出

在預設產生的程式碼加入一行 resp.setCharacterEncoding("UTF-8");
這一行必須加在 resp.setContentType("text/plain"); 之前,否則無效


public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setCharacterEncoding("UTF-8");
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world");
}
arrow
arrow
    全站熱搜

    YOUNG21975 發表在 痞客邦 留言(0) 人氣()