This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes encoding problem (communication with http server) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "encoding problem (communication with http server)" Watch "encoding problem (communication with http server)" New topic
Author

encoding problem (communication with http server)

olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
hi,

i'm using httpclient 4 to communicate with a http server.
when i send a request it gives me the result in such format: artist="XYZ" song="ABC"
the problem is that it sends utf-8 encodet (eg. sven v\u00e4th as artist)
how can i convert this to get displayed correctly?
when i try it with: String artist = "väth"; it works

i even tried it with: new String(artistName.getBytes("Cp1252"), "UTF8"));
but thats not working
olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
as workaround i'm using now the .replace function and replace the most common chars myself... but there must be a better solution for this
if someone has a tip, please let me know
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: encoding problem (communication with http server)
 
Similar Threads
Checking for Object Type
Regarding Objects Generated by Objects
Model or bean class is not available to Action Class
No Deserializer found to deserialize
for if else + Output Problem (array)