[darcs-devel] [patch1226] resolve issue2416: removed obsolete Darcs.Util.ByteStr...

Ben Franksen bugs at darcs.net
Sun Nov 16 17:08:04 UTC 2014


Ben Franksen <benjamin.franksen at helmholtz-berlin.de> added the comment:

OMG. This is all so messed up I am getting headaches just from thinking
about it.

So (since patch777) we do 'setFileSystemEncoding char8'. And since we do
that before 'System.IO.initForeignEncoding' has been called for the
first time, it permanently overrides the users locale, as seen by all
Haskell libraries. IIUC, the main reason it's been done that way is so
that things like file names can be round-tripped no matter what the
encoding is.

On the other hand, we want to store patch meta data in utf-8. But stuff
from the command line is (unfortunately?) also subject to encoding,
using initForeignEncoding, which we globally set to char8. Therefore the
decodeString function.

We can solve the original problem (issue2416) by adding a reverse
function to Darcs.Util.ByteString and using that in the Option
definitions when defining ounparse.

The larger problem (the reason we enforce char8 as the default) should
perhaps be discussed elsewhere.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1226>
__________________________________


More information about the darcs-devel mailing list