• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading special characters -- JSP  RSS feed

 
Deepan Ignatius
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Assume I have a table named "PRODUCT_INFO" which has two fields product_id and product_name where product_id is the primary key.

On my JSP page, I am reading the values present in PRODUCT_INFO [table name] and listing it under a list box. Of that, 1 particular product(got from the table) has a unique name [DNA ”Kotimokkula”Option GlobeSurfer III]. When getting listed in that dropdown list box, it is appearing as it is.

Upon selecting this product and giving submit it goes to a servlet where when I read this vale thru request parameter it is giving [DNA ?Kotimokkula?Option GlobeSurfer III] instead of the original name present in the table PRODUCT_INFO which is [DNA ”Kotimokkula”Option GlobeSurfer III].

My next objective is to find the product_id corresponding to this product [DNA ”Kotimokkula”Option GlobeSurfer III]. Since I am getting the value as a different one from the original one present in the table I am unable to get the product id but instead getting null.

I am using the following character set in my jsp page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>

Could any of you help me to find out the root cause and how to arrive at a solution without changing the product name present in the table?

PS: The special character present in the original product (in table PRODUCT_INFO) is a tilted double quotes. I guess this is not shown clearly in this message as well
 
subodh k kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try with
<%@ page contentType="text/html; charset=UTF-8" %>
 
Deepan Ignatius
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still not working, getting the same result
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!