File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

encoding problem (communication with http server)

 
olze oli
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic