Coding problem (Russian)



  • How to solve the coding problem, when the line is recorded in the file (if the Russian text) the text is not readable

       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();
        }
    


  • According to the https://stackoverflow.com/a/6998929/3212712 may be codified:

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



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2