How to solve the problem with the encoding, after writing the line to the file (if the text is in Russian) the text becomes unreadable

String outText = "мой текст"; try { // открываем поток для записи BufferedWriter bw = new BufferedWriter(new FileWriter(sdFile)); // пишем данные bw.write(outText); // закрываем поток bw.close(); Log.d(TAG, "Файл записан на SD: " + sdFile.getAbsolutePath()); } catch (IOException e) { e.printStackTrace(); } 

    1 answer 1

    According to en-SO, you can force the encoding:

     BufferedWriter bw = new BufferedWriter (new OutputStreamWriter(new FileOutputStream(sdFile), "UTF-8"));