增加笔记乱码

pdf
pan 4 years ago
parent e0163cb0c2
commit 5a57ac5a71
  1. 3
      src/main/java/com/bupt/note/Controller/NoteController.java

@ -23,6 +23,7 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@ -78,7 +79,7 @@ public class NoteController {
paperNote.setUserName(username);
paperNoteRepository.save(paperNote);
}
wr = new FileWriter(f);
wr = new FileWriter(f, StandardCharsets.UTF_8);
wr.write(noteForm.getContent());
return ResponseDataUtil.buildSuccess(note);
} catch (IOException e) {

Loading…
Cancel
Save