For a quick-n-dirty test I am printing out a utf-8 string using System.out.println(). This is on a Windows Vista (USA) system using JDK 1.6.0_07. The String is constructed with a byte of UTF-8 encoded bytes using, eg. String myUTF8String = new String(myByteBuffer, "UTF-8"). The IDEA console tab contains gibberish characters for high order characters such as Arabic ones, example: 'Ø³Ù…ÙˆØ§Ù„Ø´ÙŠØ®' instead of the actual Arabic ones. I know my byte array is correct because if I send it to a file (using -Dfile.encoding=UTF-8 as a VM parameter) I get the correct characters. Also, if I examine myUTF8String in the IDEA Debugger tab I see the correct Arabic characters. My understanding is that System.out.println() uses the default system encoding, which for Windows is not UTF-8. Assuming this is the issue with the Console tab I tried:
OutputStreamWriter nosw = new OutputStreamWriter(System.out,"UTF-8");
but this yielded the same results. Any pointers on this would be appreciated.