Hi,
I have tried the solution suggested in link provided, but it did not solve the 
problem i.e. I tried changing my code to

String s2 = new String(ResultSet.getBytes(),"ISO-8859-1");

The result is the PDF is still the string "\u0141" and not the character value 
i.e it is not what is being displayed by using a String definition

String s = "\u0141";

Please help

Thanks and Regards
Munesh Gupta

-----Original Message-----
From: 1T3XT info [mailto:[email protected]] 
Sent: Wednesday, March 11, 2009 8:04 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Problem displaying special characters read from 
Java Resultset in PDF

munesh wrote:
> Hi,
> I am facing problems while displaying special chracters in PDF generated by
> iText.

It's not an iText problem.

> If i define String for special characters in my java code and display the
> same in PDF using iText, it works fine,

You say it yourself: it works fine; it's not an iText problem!

> however, if i read the same String
> from java.sql.ResultSet, it is displayed as String and not the special
> character i.e. for e.g.
> 
> String s = new String("\u0141") is displayed correctly as a special
> character in PDF generated by iText, however, if i read the same String from
> Database, the plain text is displayed i.e.
> 
> String s2 = ResultSet.getString();
> The value of s2 is "\u0141"
> 
> My Database is Oracle and the encoding is "WE8ISO8859P1" which i beleive is
> 8859_1

But... but... you are giving the answer to your own question yourself!
It's an encoding problem! Read this tip of the day dating from 2004:
http://rickproctor.blogspot.com/2004/06/java-quick-tip-of-day-character.html

Another way to solve the problem, would be to make sure all the 
components you are using have the same encoding in their configuration.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to