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ââ?¬Â? 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

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ââ
ModuleNotFoundError: No module named 'utf-remote'
ModuleNotFoundError: No module named 'utf-remote'  Hi, My Python... 'utf-remote' How to remove the ModuleNotFoundError: No module named 'utf... have to install padas library. You can install utf-remote python
Advertisements
XML base64 ecoding - XML
Reading UTF - 8 Encoded Data in Java
java
java  what is purpose of UTF
Set encoding from within SQL*Plus
Set encoding from within SQL*Plus  Hi, In Oracle server I am running sql query from sqlplus which is adding Spanish data. But data is converted wrongly due to UTF conversion. How to resolve this. Thanks   Hi, Run
input output
., "File System Safe UCS Transformation Format (FSS_UTF)", X/Open

Ads