After searching for 4 straight hours now, I have to give up and ask you guys. I have a very simple form which will take an input and on action, write it to my Oracle DB (which supports UTF-8).
<form action="test.jsp" method='GET' accept-charset="UTF-8">
<label for='NAME'>Name</label><input type="text" id="NAME" name="NAME"/>
<button type="submit">Submit</button>
</form>
All I want to do is the form to be able to accept characters such as é
or 请
and store them without changing the encoding.
I already have tried (and combined) options such as setting
request.setCharacterEncoding("UTF-8");
or building a new String with encoding parameter:
new String(request.getParameter("NAME").getBytes(), "UTF-8")
but it always ends up in the database like this: �?��??
(Input: 收藏
)
Any help on the subject would be greatly appreciated.