summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar https://www.google.com/accounts/o8/id?id=AItOawk5aY0oBmuQtnoTNtji-dPgDw9p7J24YeY <Ji@web>2014-03-19 16:24:07 +0000
committerGravatar admin <admin@branchable.com>2014-03-19 16:24:07 +0000
commit535b3aa7320547af1833b9cb610b022efe7ea97b (patch)
tree5ffe36fa5f03df2df829f5fd58694eebd35881dc
parent7cfce2b3318d742c7910f930353c5880b56739fb (diff)
Added a comment: further info 3
-rw-r--r--doc/bugs/Unicode_file_names_ignored_on_Windows/comment_7_b23a2bf106053f105798b270536057e5._comment38
1 files changed, 38 insertions, 0 deletions
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 000000000..b5cf90ef0
--- /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.
+"""]]