This commit is contained in:
James Muehlner
2013-07-09 11:14:41 -07:00
parent b44faacbae
commit d0ae81fa0c
6 changed files with 27 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ package net.sourceforge.guacamole.net.basic;
*/
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -226,6 +227,15 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
// Set character encoding to UTF-8 if it's not already set
if(request.getCharacterEncoding() == null) {
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException exception) {
throw new ServletException(exception);
}
}
HttpSession httpSession = request.getSession(true);

View File

@@ -92,6 +92,9 @@ public class List extends AuthenticatingHttpServlet {
// Write XML content type
response.setHeader("Content-Type", "text/xml");
// Set encoding
response.setCharacterEncoding("UTF-8");
// Get connection directory
Directory<String, Connection> directory = context.getConnectionDirectory();

View File

@@ -101,6 +101,9 @@ public class List extends AuthenticatingHttpServlet {
// Do not cache
response.setHeader("Cache-Control", "no-cache");
// Set encoding
response.setCharacterEncoding("UTF-8");
// Write actual XML
try {

View File

@@ -199,6 +199,9 @@ public class List extends AuthenticatingHttpServlet {
// Do not cache
response.setHeader("Cache-Control", "no-cache");
// Set encoding
response.setCharacterEncoding("UTF-8");
// Map of all available protocols
Map<String, ProtocolInfo> protocols = new HashMap<String, ProtocolInfo>();

View File

@@ -50,6 +50,9 @@ public class List extends AuthenticatingHttpServlet {
// Write XML content type
response.setHeader("Content-Type", "text/xml");
// Set encoding
response.setCharacterEncoding("UTF-8");
// Write actual XML
try {