Skip to content

Write files as UTF-8 without BOM, as for example NetBeans does. #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/clooj/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
WindowAdapter KeyAdapter)
(java.awt AWTEvent Color Font GridLayout Toolkit)
(java.net URL)
(java.io File FileReader FileWriter StringReader))
(java.io File FileReader StringReader
BufferedWriter OutputStreamWriter FileOutputStream))
(:use [clojure.contrib.duck-streams :only (writer)]
[clojure.pprint :only (pprint)]
[clooj.brackets]
Expand Down Expand Up @@ -541,7 +542,10 @@
(try
(let [f @(app :file)
ft (File. (str (.getAbsolutePath f) "~"))]
(with-open [writer (FileWriter. f)]
(with-open [writer (BufferedWriter.
(OutputStreamWriter.
(FileOutputStream. f)
"UTF-8"))]
(.write (app :doc-text-area) writer))
(send-off temp-file-manager (fn [_] 0))
(.delete ft)
Expand Down