the default encoding is (possibly ISO-8859-1 or US-ASCII?) but it doesn’t seem to be UTF-8, which is odd given that java strings are supposed to be unicode. This causes a problem if you want to have non-ascii characters and you don’t realise what’s happening. This was a bug in SQLEditor and somebody accidentally typed an umlaut into one of the fields and the file wouldn’t reload. (Which was annoying).The correct thing to do seems to be to use the following:OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(path),"UTF-8");My question is :
1. Not use FileOutputStream.Beacuse I must use File object (return by the third external api)
2. How to use File object to write utf8When I use FileWriter,there are error encode for special char.(like ?)JavaUTF-8APIfilewriter