I stuck up while working with Unicode(Nepali) in Servlet. Well I submit (POST Method) HTML form and wanted to store in database. But could not get exact unicode.
I tried following things -
new String(request.getParameter("nameNep").getBytes("iso-8859-1"),"utf-8")
Result of above code is ?????? ????
like string
byte[] utf8Bytes = request.getParameter("nameNep").("UTF8"); String text = new String(utf8Bytes,"UTF8");
this code generate text like म�द�र �न
, and is actually same result as request.getParameter("nameNep")
URLDecoder.decode(request.getParameter("nameNep"), "UTF-8");
same result as 2
request.setCharacterSet("UTF-8");
setting this up before any action on request, got same result as 2 & 3
What i am doing mistake here , the form field nameNep contains nepali Unicode characters.