We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e4fd51 commit e7cb9fdCopy full SHA for e7cb9fd
System/OsPath/Internal.hs
@@ -56,8 +56,12 @@ unsafeEncodeUtf :: HasCallStack => String -> OsString
56
unsafeEncodeUtf = OS.unsafeEncodeUtf
57
58
-- | Encode a 'FilePath' with the specified encoding.
59
+--
60
+-- Note: on windows, we expect a "wide char" encoding (e.g. UCS-2 or UTF-16). Anything
61
+-- that works with @Word16@ boundaries. Picking an incompatible encoding may crash
62
+-- filepath operations.
63
encodeWith :: TextEncoding -- ^ unix text encoding
- -> TextEncoding -- ^ windows text encoding
64
+ -> TextEncoding -- ^ windows text encoding (wide char)
65
-> FilePath
66
-> Either EncodingException OsPath
67
encodeWith = OS.encodeWith
0 commit comments