aboutsummaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-02-10 14:21:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-02-10 14:21:44 -0400
commitfe55b4644e67bba60b35e07abcdd312b65c9d6f3 (patch)
tree4631f428f86f72d614f9b5388772b6ec58a3fb8d /Messages.hs
parente7a3475704f5366e89aebe78cefbeb58ff5ab181 (diff)
Fix display of unicode filenames.
Internally, the filenames are stored as un-decoded unicode. I tried decoding them, but then haskell tries to access the wrong files. Hmm. So, I've unhappily chosen option "B", which is to decode filenames before they are displayed.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Messages.hs b/Messages.hs
index 6f4ec1e62..12a836d3c 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -11,6 +11,7 @@ import Control.Monad.State (liftIO)
import System.IO
import Control.Monad (unless)
import Data.String.Utils
+import Codec.Binary.UTF8.String as UTF8
import Types
import qualified Annex
@@ -25,7 +26,7 @@ showSideAction s = verbose $ liftIO $ putStrLn $ "(" ++ s ++ ")"
showStart :: String -> String -> Annex ()
showStart command file = verbose $ do
- liftIO $ putStr $ command ++ " " ++ file ++ " "
+ liftIO $ putStr $ command ++ " " ++ showFile file ++ " "
liftIO $ hFlush stdout
showNote :: String -> Annex ()
@@ -45,7 +46,6 @@ showEndOk = verbose $ liftIO $ putStrLn "ok"
showEndFail :: Annex ()
showEndFail = verbose $ liftIO $ putStrLn "\nfailed"
-{- Exception pretty-printing. -}
showErr :: (Show a) => a -> Annex ()
showErr e = warning $ "git-annex: " ++ show e
@@ -57,3 +57,8 @@ warning w = do
indent :: String -> String
indent s = join "\n" $ map (\l -> " " ++ l) $ lines s
+
+{- Prepares a filename for display. This is needed because strings are
+ - internally represented in git-annex is non-decoded form. -}
+showFile :: String -> String
+showFile = decodeString