[darcs-users] encoding problems in darcs 2.5

Eric Kow kowey at darcs.net
Fri Dec 17 10:04:09 UTC 2010

Hi Wolfgang, Reinier.

Reinier, I think we may have found one general direction to look into
for issue1693.  I've updated the ticket to point to this message.

On Thu, Dec 16, 2010 at 23:37:49 +0100, Wolfgang Jeltsch wrote:
> Now, I’ve found the root of this problem. In src/darcs.hs there is this
> line:
>     forM_ [stdout, stdin, stderr] $ \h -> hSetBinaryMode h True

Ah ha! This reminds me of this IO audit I did in May

Looks like my assumption yesterday was wrong when I said

  when it prints String, it uses hPutStr h
  I *assume* hPutStr stdout uses the locale...

How embarrassing, should have been more awake.

> However, I’m not sure whether commenting this line out can cause new
> problems. Maybe, a darcs that is accessed via SSH could now send data to
> the client in a wrong way if it uses something like hPutStr on stdout.

Hmm, so the client end at least still sets hSetBinaryMode for its IO and for
server end, darcs transfer-mode seems to output bytestrings only.  But this
could use a bit more research.

Since I know what I'm looking for, I know that I can search through the
history using

   darcs changes --match 'hunk hSetBinaryMode' --summary 

I learned that the hSetBinaryMode was introduced actually very early in
Darcs' code (not during 2.4.4; that was just for calling externals like
> During debugging, I found out something that seemed strange to me:
> Printer.hPrintPrintable is apparently only called with such values of
> type Printer that represent a single-character string. So when
> outputting to the terminal, hPrintPrintable is called once for every
> character.
> There is another encoding issue. The file _darcs/prefs/author is written
> in the local encoding, not UTF-8. Therefore, it isn’t portable. Changing
> the character set or copying a repo to a another machine that uses a
> different character set will produce wrong author names.

Hmm, thanks.  Wolfgang: would you be kind enough to send an email to
bugs at darcs.net for these two issues (each)?  The latter *may* be desirable,


Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey at jabber.fr (Jabber or Google Talk only)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101217/c8573aec/attachment.pgp>

More information about the darcs-users mailing list