There are two questions here:
- you are converting something from somewhere and the end result is a
Java String
- you take the Java String above and show it in the PDF
The first question has nothing to do with iText and whatever you do
iText is only interested in a real Unicode Java String. If you can
disply your string or not in a web page is irrelevant, your string may
match the web page encoding and not be Unicode at all.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of is_maximum
> Sent: Monday, April 09, 2007 6:16 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] Problem with UTF-8 String and PDF
>
>
> no, the result is right and I can display them in a web page
> properly.
> and I want to say that the resultSet is not the same
> java.sql.ResultSet it
> is a class I implement it to use Lucene results.
>
> the strange thing is that if I dont use getBytes("UTF-8") the
> displayed info
> in result pdf are weird characters but if I specify that line (I mean
> getBytes("UTF-8") ) in result no string will be displayed
> and I see a blank
> space !
>
>
>
> Paulo Soares wrote:
> >
> > The conversion part is:
> >
> > new String(resultSet.getString(ch.getName()).getBytes("UTF-8"))
> >
> > I don't see any iText in it. If the DB is well configured
> > resultSet.getString(ch.getName()) will get you the right text. If it
> > doesn't
> > it's not iText fault.
> >
> > Paulo
> >
> > ----- Original Message -----
> > From: "is_maximum" <[EMAIL PROTECTED]>
> > To: <itext-questions@lists.sourceforge.net>
> > Sent: Sunday, April 08, 2007 2:15 PM
> > Subject: [iText-questions] Problem with UTF-8 String and PDF
> >
> >
> >>
> >> Hi all
> >>
> >> I want to create pdf document and my strings encoding are
> in UTF-8 but
> >> after
> >> creating document, the letters are weird.
> >> Do iText suport utf-8 encoding?
> >>
> >> my snippet code is like this:
> >> Font myfont = FontFactory.getFont("Tahoma", 8,
> Font.BOLD,Color.BLACK);
> >>
> >> PdfPCell cell = new PdfPCell(new Paragraph(new
> >>
> String(resultSet.getString(ch.getName()).getBytes("UTF-8")), myfont));
> >>
> >>
> >> Thank you very much
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/