Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可以预见的问题getBytes()与UTF-8字符串表示有关。做了以下事情,然后一切都很好:
getBytes()
UTF-8
he.sendResponseHeaders(200, response.getBytes("UTF-8").length); OutputStream os = he.getResponseBody(); os.write(response.getBytes("UTF-8"));