This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Displaying Chinese data in html Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Displaying Chinese data in html" Watch "Displaying Chinese data in html" New topic
Author

Displaying Chinese data in html

Sara Tracy
Ranch Hand

Joined: Jan 06, 2006
Posts: 45
Hi,

This question pertains to PLSQL Web Applications.

I'm trying to display some Chinese data on a html page. The data is stored as CLOB in the Oracle database. This piece of code works fine for English data, but for Chinese data it displays upside down question marks. I'm sure it is an encoding issue, but I don't know how to resolve it. Can anybody help me please.

=====================================================
stem clob;
begin
select v.xtext.getClobVal()
into stem
from item_text v
where item_identifier = 31784;

htp.print('<html>');
htp.print('<head>');
htp.print('<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>');
htp.print('<meta http-equiv="Content-Language" content="zh">');
htp.print('</head>');
htp.print('<body>');
htp.print('you have reached the chinese page !!');
htp.print(stem);
htp.print('</body></html>');
end;
===================================

Also when I run the below statement in iSQLPLus, I'm able to get the correct Chinese data.

select v.xtext
from item_text v
where item_identifier = 31784;

Thanks
-S
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Start by reading this article.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Displaying Chinese data in html
 
Similar Threads
the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is
Re: Navigation Restriction
Help!! Chinese(Big 5) Display Problem
JSP returning old data, database was changed correctly!
saving chinese data to text file