java - conwert object which contains strings with utf-8 to string with proper coding -


i'm processing mms , got text part :

mmsbodypart.getcontent();  

it's simpy object. need convert string using utf-8. have tried:

string contenttext = (string) mmsbodypart.getcontent(); 

but doesn't works specyfics characters , strange chars appear. tried :

string content = new string(contenttext.getbytes("utf-8"), "utf-8")); 

not mystery failed.

how can done ?

edit: problem caused bad encoding in file. nothing wrong in code, ya didn't thought in first place...

strings haven't encoding in java. if need one, should use byte[] encoding string


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -