Encoding conversion from UTF to ISO-8859-7
- From: "MEARTURO" <arturo_mtz_e@xxxxxxxxx>
- Date: 30 Jun 2006 04:25:08 -0700
Hello all,
I have a problem with some encoding conversion from UTF to ISO-8859-7 .
My Oracle database uses UTF but some POS printers in the organization
use ISO-8859-7, so I need to print some Greek characters.
This is part of the code:
Charset set7 = Charset.forName("ISO-8859-7");
ByteBuffer BBtext3 = null,
tempDB = rs.getString(1); //The string in Greek. Oracle UTF
BBtext3 = set7.encode(tempDB); //The string in Greek ISO-8859-7
When I debug this code I see that BBtext3 has these values:
[0] = -51
[1] = -59
[2] = -45
and so on
If I add 256 to those numbers I get:
[0] = 205
[1] = 197
[2] = 211
Which are the positions in ISO-8859-7 of the Greek letters of the UTF
text.
If I send the original string to the printer I get '?' because there is
no such thing as character -51.
What am I missing? How can I complete the conversion from UTF to
ISO-8859-7? It seems that I'm half the way.
Thanks a lot for your time.
.
- Follow-Ups:
- Re: Encoding conversion from UTF to ISO-8859-7
- From: Bill Medland
- Re: Encoding conversion from UTF to ISO-8859-7
- Prev by Date: Re: JSP and Java Swings reuse of code
- Next by Date: Ant task for database script
- Previous by thread: File Creation
- Next by thread: Re: Encoding conversion from UTF to ISO-8859-7
- Index(es):
Relevant Pages
|