[darcs-users] encoding problems in darcs 2.5

Wolfgang Jeltsch jeltsch at Informatik.tu-Cottbus.DE
Fri Dec 17 16:41:04 UTC 2010


Am Freitag, den 17.12.2010, 10:04 +0000 schrieb Eric Kow:
> […]
> 
> 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
> 
> […]
> 
> > 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.

In the short run, I’d be interested whether removing the above line on
the *client* could cause any problems. Does the client use stdout or
stderr to communicate via SSH? (I suppose not, since I suppose that the
client uses these streams only to communicate with the user.)

> Since I know what I'm looking for, I know that I can search through the
> history using
> 
>    darcs changes --match 'hunk hSetBinaryMode' --summary 

Don’t forget to also look for openBinaryFile.

> > 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,
> though.

I’ll do so.

Best wishes,
Wolfgang



More information about the darcs-users mailing list