0

Our application download files using HttpClient. We take the filename from the HTTP Header and emit out as SysOut (System.out.println())

When there are non-USASCII characters like umlauts the sysout does not decode correctlty.

Ex: filename Textkürzung.txt is printed in sysout (And also in console) as Textk³rzung.txt

How can we encode this to UTF-8? Unfortunately we don't get the encoded character-set from the HTTP Headers

Rajkumar R
  • 19
  • 1
  • If you cannot ask the servers owner for the encoding, try ISO8859-1. – Gren Jan 30 '15 at 17:33
  • Which console? The Windows console for example cannot display UTF-8 characters – a_horse_with_no_name Jan 30 '15 at 18:06
  • System.out uses platform encoding. Use a PrintStream to control the implicit encoded translation. Pehaps this will help: http://stackoverflow.com/questions/10143998/cyrillic-in-windows-consolejava-system-out-println –  Jan 30 '15 at 20:12

0 Answers0