0

I am using JSP pages and I am trying to get the UTF-8 value from query string using the statements as below request.getparameter("q");

It is working fine, it gives me the appropriate results but when I am trying it using IE9 it gives me ????? instead of unicode value.

My question is how do I get proper unicode value from query string using JSP that will gives correct values on all browser including IE, and what statements I need to add within JSP page to get correct values at IE as well.

Please help me in this regard.

thank you

Michal Borek
  • 4,544
  • 2
  • 28
  • 40

1 Answers1

1

In the jsp page directive you need to set content-type to utf-8 (for each jsp page)

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="ISO-8859-1" %>

If still problem persist then use this SO question to handle encoding for DB, Tomcat. HERE

Community
  • 1
  • 1
Alpesh Gediya
  • 3,618
  • 1
  • 24
  • 36