1

I am reading in my servlet a value from a form, which the value is written in Greek with

s1 = request.getParameter("Name");

However if I print it to the log right after the above,I get a $%^&. Moreover if save it in my DB (SQLite) and later read this value I get also a $%^& In my jsp page I have added:

<%@page contentType="text/html" pageEncoding="UTF-8" language="java" %>

and in the server.xml there is the URIEncoding="utf-8"

yaylitzis
  • 5,354
  • 17
  • 62
  • 107
  • Have you tried writing the value to a log or looking at it in a debugger to see that it is correct when you receive it? Do you see it properly in the sqlite database if you look at it directly? And when you get it from the database, how do you know what its content is? Where are you printing it? – RealSkeptic Jul 15 '15 at 18:23
  • its a mess from the beginning (when i read it from the form) – yaylitzis Jul 15 '15 at 18:25
  • Can you add the actual value that is supposed to be there, and the actual value that you get to your question? – RealSkeptic Jul 15 '15 at 18:26
  • Î123 Instead of Δ123 – yaylitzis Jul 15 '15 at 18:30
  • check this link http://stackoverflow.com/questions/31448655/how-can-i-read-a-utf-8-value-in-my-servlet – Avinash Reddy Jul 16 '15 at 10:29
  • Also this as well http://stackoverflow.com/questions/2630748/how-to-enable-reading-non-ascii-characters-in-servlets – Avinash Reddy Jul 16 '15 at 10:30

0 Answers0