From e5b0ba4d0b737285c18886b0c9dcd40985cc7d1b Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawk5aY0oBmuQtnoTNtji-dPgDw9p7J24YeY" Date: Wed, 19 Mar 2014 16:24:07 +0000 Subject: [PATCH] Added a comment: further info 3 --- ..._b23a2bf106053f105798b270536057e5._comment | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 doc/bugs/Unicode_file_names_ignored_on_Windows/comment_7_b23a2bf106053f105798b270536057e5._comment diff --git a/doc/bugs/Unicode_file_names_ignored_on_Windows/comment_7_b23a2bf106053f105798b270536057e5._comment b/doc/bugs/Unicode_file_names_ignored_on_Windows/comment_7_b23a2bf106053f105798b270536057e5._comment new file mode 100644 index 0000000000..b5cf90ef05 --- /dev/null +++ b/doc/bugs/Unicode_file_names_ignored_on_Windows/comment_7_b23a2bf106053f105798b270536057e5._comment @@ -0,0 +1,38 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawk5aY0oBmuQtnoTNtji-dPgDw9p7J24YeY" + nickname="Jiří" + subject="further info 3" + date="2014-03-19T16:23:58Z" + content=""" +Also ghc doesn't seem to do any weird transformations with that string + + import System.Process + import qualified Data.ByteString as S + import qualified Data.ByteString.UTF8 as U + import GHC.IO.Handle + + files :: S.ByteString -> [S.ByteString] + files ps + | S.null ps = [] + | otherwise = case search ps of + Nothing -> [ps] + Just n -> S.take n ps : files (S.drop (n+1) ps) + where search = S.elemIndex 0 + + main = do + let prc = CreateProcess { + cmdspec = RawCommand \"git\" [\"--work-tree=D:\\antest\",\"ls-files\",\"--others\",\"-z\",\"--\",\"h\225\269ky.txt\"], + cwd = Nothing, + env = Nothing, + std_in = Inherit, + std_out = CreatePipe, + std_err = Inherit, + close_fds = False, + create_group = False } + (_,Just out,_,_) <- createProcess prc + hSetBinaryMode out True + str <- S.hGetContents out + print $ map U.toString $ files str + +prints correctly [\"h\225\269ky.txt\"] I don't think that FilesystemEncoding will do any good on windows, since git seems to use utf-8 instead of normal windows console encoding. +"""]]