From 1fd47e812136ea23af8162820f0c30bc72b69725 Mon Sep 17 00:00:00 2001 From: Lev Dvorkin Date: Fri, 18 Nov 2022 23:31:51 +0300 Subject: [PATCH] utf8-for-write-handle-specified --- src/Main.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Main.hs b/src/Main.hs index a41c1d86..a6de853a 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -163,6 +163,7 @@ file sa conf mfp = do Just _ | not (saInPlace sa) -> putStrNewline new Just path | not (null new) && old /= new -> IO.withFile path IO.WriteMode $ \h -> do + IO.hSetEncoding h IO.utf8 setNewlineMode h IO.hPutStr h new _ -> return ()