File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ Bug fixes:
1616 really only wanted to disable their test suites, which was already
1717 handled by a later
1818 patch. [ #2849 ] ( https://github.com/commercialhaskell/stack/issues/2849 )
19+ * ` stack new ` always treats templates as being UTF-8 encoding,
20+ ignoring locale settings on a local machine. See
21+ [ Yesod mailing list discussion] ( https://groups.google.com/d/msg/yesodweb/ZyWLsJOtY0c/aejf9E7rCAAJ )
1922
2023## 1.3.0
2124
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import Control.Monad.Reader
2626import Control.Monad.Trans.Writer.Strict
2727import Data.Aeson
2828import Data.Aeson.Types
29+ import qualified Data.ByteString as SB
2930import qualified Data.ByteString.Lazy as LB
3031import Data.Conduit
3132import Data.Foldable (asum )
@@ -41,6 +42,7 @@ import qualified Data.Set as S
4142import Data.Text (Text )
4243import qualified Data.Text as T
4344import qualified Data.Text.Encoding as T
45+ import qualified Data.Text.Encoding.Error as T (lenientDecode )
4446import qualified Data.Text.IO as T
4547import qualified Data.Text.Lazy as LT
4648import Data.Time.Calendar
@@ -157,7 +159,7 @@ loadTemplate name logIt = do
157159 <> " \" " )
158160 exists <- doesFileExist path
159161 if exists
160- then liftIO (T. readFile (toFilePath path))
162+ then liftIO (fmap ( T. decodeUtf8With T. lenientDecode) ( SB. readFile (toFilePath path) ))
161163 else throwM (FailedToLoadTemplate name (toFilePath path))
162164 relRequest :: MonadThrow n => Path Rel File -> n Request
163165 relRequest rel = parseRequest (defaultTemplateUrl <> " /" <> toFilePath rel)
You can’t perform that action at this time.
0 commit comments