Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sunanda
UTF ecoding
0 Answer(s)      3 years and 2 months ago
Posted in : JSP-Servlet


Hi, I am retriving description field from DB as this st = conn.prepareStatement("SELECT description,assetid FROM assetdb.assets a where assetid=1299581636"); The description field value is "Where √Ę‚?¨Ň?in-country√Ę‚?¨¬? hosting solutions are part of the contract requirement" My requirement is to display it in jsp like "Where "in-country" hosting solutions are part of the contract requirement"

My approach is

DBUtils.java

public String getAsset() { byte[] b = rs.getBytes("description"); utf8Str = new String(b, "UTF-8"); ... }

EditdbAction.java

request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); DBUtils db= new DBUtils() String utf8Str = db.getAsset(); HttpSession session = request.getSession(true); session.setAttribute("descrption", utf8Str);

assetResult.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%>

JSP Page div> <%String results = (String) session.getAttribute("descrption"); if (results != null) { out.println("results :" + results);} %>

But I m nt able to display it properly...please help


Advertisement
View Answers

Related Tutorials/Questions & Answers:
UTF ecoding
UTF ecoding  Hi, I am retriving description field from DB as this st = conn.prepareStatement("SELECT description,assetid FROM assetdb.assets a where assetid=1299581636"); The description field value is "Where √Ę‚?¨Ň?in-country√Ę‚
Advertisements
java
java  what is purpose of UTF
input output
., "File System Safe UCS Transformation Format (FSS_UTF)", X/Open
Input And Output
Company Ltd., "File System Safe UCS Transformation Format (FSS_UTF)", X
Advertisements
 

 

 

DMCA.com