Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed encoding issues in inspectors

  • Loading branch information...
commit 9eccd2fa8b4ad016bc2e3b082c12caa25060bb5b 1 parent 2894116
@mvoidex mvoidex authored
Showing with 6 additions and 4 deletions.
  1. +3 −2 CabalInspector.hs
  2. +3 −2 ModuleInspector.hs
View
5 CabalInspector.hs
@@ -5,7 +5,8 @@ module Main where
import Control.Arrow
import qualified Data.Aeson as Json
import Data.Aeson ((.=))
-import qualified Data.ByteString.Lazy.Char8 as LazyByteString
+import qualified Data.Text.Lazy.Encoding as T
+import qualified Data.Text.Lazy.IO as T
import Distribution.PackageDescription
import Distribution.PackageDescription.Parse
import qualified System.Environment as Environment
@@ -44,5 +45,5 @@ main = do
output = case analyzeCabal source of
Left excuse -> Json.toJSON $ Json.object ["error" .= excuse]
Right info -> Json.toJSON info
- LazyByteString.putStrLn . Json.encode $ output
+ T.putStrLn . T.decodeUtf8 . Json.encode $ output
_ -> putStrLn ("Usage: " ++ programName ++ " FILENAME")
View
5 ModuleInspector.hs
@@ -6,7 +6,8 @@ module Main where
import qualified Data.Aeson as Json
import Data.Aeson ((.=))
-import qualified Data.ByteString.Lazy.Char8 as LazyByteString
+import qualified Data.Text.Lazy.Encoding as T
+import qualified Data.Text.Lazy.IO as T
import qualified Language.Haskell.Exts as H
import qualified System.Environment as Environment
@@ -107,5 +108,5 @@ main = do
let output = case analyzeModule source of
Left excuse -> Json.toJSON $ Json.object ["error" .= excuse]
Right info -> Json.toJSON info
- LazyByteString.putStrLn . Json.encode $ output
+ T.putStrLn . T.decodeUtf8 . Json.encode $ output
_ -> putStrLn ("Usage: " ++ programName ++ " FILENAME")
Please sign in to comment.
Something went wrong with that request. Please try again.