aboutsummaryrefslogtreecommitdiff
path: root/Utility/FileSystemEncoding.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-08-12 10:36:51 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-08-12 10:36:51 -0400
commit7f9940c1f4a6a533c1d5e7cd7980419f59524ff3 (patch)
tree3e05d15a1a0544f19713d99a4d513febe8c3c8d7 /Utility/FileSystemEncoding.hs
parente588f9e1597aadfaf881b9a4b15007bd41479eed (diff)
fix test suite fail in LANG=C
This was caused by 88aeb849f620a13da47508045daae461a223c997 an Arbitrary String is not necessarily encoded using the filesystem encoding, and in a non-utf8 locale, encodeBS throws an exception on such a string. All I could think to do is limit test data to ascii. This shouldn't be a problem in practice, because the all Strings in git-annex that are not generated by Arbitrary should be loaded in a way that does apply the filesystem encoding.
Diffstat (limited to 'Utility/FileSystemEncoding.hs')
-rw-r--r--Utility/FileSystemEncoding.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utility/FileSystemEncoding.hs b/Utility/FileSystemEncoding.hs
index 25a09ecc0..5a2fab0e4 100644
--- a/Utility/FileSystemEncoding.hs
+++ b/Utility/FileSystemEncoding.hs
@@ -68,6 +68,10 @@ withFilePath fp f = Encoding.getFileSystemEncoding
- only allows doing this conversion with CStrings, and the CString buffer
- is allocated, used, and deallocated within the call, with no side
- effects.
+ -
+ - If the FilePath contains a value that is not legal in the filesystem
+ - encoding, this may throw an exception. For example, "\226" is not valid
+ - in the C locale, but is in utf locales.
-}
{-# NOINLINE _encodeFilePath #-}
_encodeFilePath :: FilePath -> String