I have a column in the PostgreSQL database which contains Arabic data. When reading the data from the database in the controller it’s been read fine, the encoding is good, but when sending the data to the JSP page and trying to read it, they appears as something like ?????????. Any ideas why something like this occur?
I have a column in the PostgreSQL database which contains Arabic data. When reading
Share
You need to set the HTTP response encoding. If you’re using JSP as view technology, then you need to add the following line to top of the JSP’s:
This will force the servletcontainer to write characters to the response in the specified encoding and this will implicitly also add the correct
charsetto the HTTPContent-Typeresponse header so that the webbrowser knows what encoding to use to display those characters.Also see this article for more insights: Unicode – How to get the characters right? Solutions for JSP/Servlet response are described here.