aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-01-28 22:11:52 +0700
committerGravatar Ugnich Anton2014-01-28 22:11:52 +0700
commit45bc7349af0696b9c68266feece63d7359260cec (patch)
tree9936534e57a52568566166f7e59a7519abe11a66 /src
parent36c8ec33c09fbfd0f82a5a4121ef63ed1ec77457 (diff)
post setCharacterEncoding
Diffstat (limited to 'src')
-rw-r--r--src/java/com/juick/http/www/Main.java4
-rw-r--r--src/java/com/juick/http/www/PM.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/java/com/juick/http/www/Main.java b/src/java/com/juick/http/www/Main.java
index 59065341..47b94387 100644
--- a/src/java/com/juick/http/www/Main.java
+++ b/src/java/com/juick/http/www/Main.java
@@ -262,6 +262,10 @@ public class Main extends HttpServlet implements Stream.StreamListener {
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ if (request.getCharacterEncoding() == null) {
+ request.setCharacterEncoding("UTF-8");
+ }
+
String uri = request.getRequestURI();
if (uri.equals("/post")) {
pagesNewMessage.doPostNewMessage(sql, request, response);
diff --git a/src/java/com/juick/http/www/PM.java b/src/java/com/juick/http/www/PM.java
index 5c0f67f9..5a07cd5a 100644
--- a/src/java/com/juick/http/www/PM.java
+++ b/src/java/com/juick/http/www/PM.java
@@ -151,7 +151,7 @@ public class PM {
out.println("<form action=\"/pm/send\" method=\"POST\" enctype=\"multipart/form-data\">");
out.println("<div class=\"newpm\">");
out.println(" <div class=\"newpm-to\">To: <input type=\"text\" name=\"uname\" placeholder=\"username\" value=\"" + uname + "\"/></div>");
- out.println(" <div class=\"newpm-body\"><textarea name=\"body\" rows=\"2\" placeholder=\"" + rbg.getString("Reply") + "\" onkeypress=\"postformListener(this.form,event)\"></textarea></div>");
+ out.println(" <div class=\"newpm-body\"><textarea name=\"body\" rows=\"2\" onkeypress=\"postformListener(this.form,event)\"></textarea></div>");
out.println(" <div class=\"newpm-send\"><input type=\"submit\" value=\"OK\"/></div>");
out.println("</div>");
out.println("</form>");