character encoding problem

B

bj

hi

i've got the following problem :
i'am getting some string with polish characters as some artifacts how
can i change these letters back to normal polish letters??
i've tried something like that

new String(b.getDescription().getBytes("UTF-8"),"ISO-8859-1")

but it didn't work, i've got still some dirty characters in string

please help
 
R

Roedy Green

i've got the following problem :
i'am getting some string with polish characters as some artifacts how
can i change these letters back to normal polish letters??
i've tried something like that

new String(b.getDescription().getBytes("UTF-8"),"ISO-8859-1")

but it didn't work, i've got still some dirty characters in string

You have to be careful with terms. A string is 16-bit characters. You
probably have some bytes, some sort of 8-bit encoding.

In any case, my essay on encoding should tell you more than you wanted
to know about translating back and forth.

http://mindprod.com/jgloss/encoding.html
 
T

Thomas Fritsch

bj said:
i've got the following problem :
i'am getting some string with polish characters as some artifacts how
can i change these letters back to normal polish letters??
i've tried something like that

new String(b.getDescription().getBytes("UTF-8"),"ISO-8859-1")

but it didn't work, i've got still some dirty characters in string
Are you really sure, that you want ISO-8859-1 ?
I doubt it, because ISO-8859-1 cannot represent some polish characters:
for example '\u0104' (A with cedilla below), '\u0141' (L with slash across).
Polish text is often encoded in ISO-8859-2, but not in ISO-8859-1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top