darcs

Issue 1693 Check displaying of Unicode patch metadata

Title Check displaying of Unicode patch metadata
Priority bug Status needs-reproduction
Milestone 2.5.2 STABLE Resolved in
Superseder Should store patch metadata in utf-8
View: 64
Nosy List asr, darcs-devel, dmitry.kurochkin, nad, tux_rocker
Assigned To tux_rocker
Topics

Created on 2009-11-15.18:08:14 by tux_rocker, last changed 2011-06-23.16:25:03 by nad.

Messages
msg9352 (view) Author: tux_rocker Date: 2009-11-15.18:08:11
When issue64 has been solved, darcs stores patch metadata as Unicode strings.
However, the code that displays the metadata was not written with non-ASCII
characters in mind. I believe I saw that it replaces non-ASCII characters with
numerical escapes, but I have not been able to find code for that in the Printer
module.

There is also the conceptual question of how to make Printer.renderPS treat
non-ASCII characters.
msg13112 (view) Author: kowey Date: 2010-11-19.10:13:45
Is this worthy of a Darcs 2.5.1?
Lele just experienced an issue similar to issue1990
msg13156 (view) Author: tux_rocker Date: 2010-11-21.16:24:24
If we get a fix, yes.

I looked at it for a bit and ultimately what happens is that hPutStr
writes only the lowest 8 bits of a character with a code point > 255. To
solve this, we must either explicitly encode the text with the locale
encoding before hPutStr'ing it, or we require GHC >= 6.12 and don't
switch file handles to binary mode.

The latter solution seems better because it is what the IO library is
designed for. But I don't know which parts of darcs require the file
handles to be in binary mode, and why.

Note that for the Windows line ending behavior that the "binary mode"
flag in C is for, you don't have to put the handle in binary mode in
Haskell. 'hSetNewlineMode noNewlineTranslation' will do that for you and
still write characters outside of latin1 correctly.
msg13160 (view) Author: mornfall Date: 2010-11-21.17:17:51
Reinier Lamers <bugs@darcs.net> writes:
> I looked at it for a bit and ultimately what happens is that hPutStr
> writes only the lowest 8 bits of a character with a code point > 255. To
> solve this, we must either explicitly encode the text with the locale
> encoding before hPutStr'ing it, or we require GHC >= 6.12 and don't
> switch file handles to binary mode.

We can't do the latter, since it breaks windows. Non-binary handles only
work with ghc <= 6.10 on that platform, encountering a "bad" character
with 6.12 or later will crash the program. Happens to darcs a lot for
various reasons. You really need to use binary handles for everything.

Yours,
  Petr.
msg13356 (view) Author: kowey Date: 2010-12-16.16:44:14
We made an impromptu attempt at working out what was going on in
http://irclog.perlgeek.de/darcs/2010-12-16#i_3094602

It probably duplicates a lot of stuff that Reinier already knows, but 
never hurts to repeat the what-the-heck-is-darcs-doing exercise across 
different members of the team
msg13373 (view) Author: kowey Date: 2010-12-17.10:11:20
These two emails may be relevant:

 - http://lists.osuosl.org/pipermail/darcs-users/2010-
December/025932.html
 - http://lists.osuosl.org/pipermail/darcs-users/2010-May/024023.html
msg13466 (view) Author: ganesh Date: 2011-01-05.23:16:15
Bumping to 2.5.2 - if a fix appears soon it might still make 2.5.1.
msg14549 (view) Author: nad Date: 2011-06-23.16:25:03
I just want to note that, due to this bug (in particular, the kind of
output described in issue 1990), I am still using darcs 2.4.4.
History
Date User Action Args
2009-11-15 18:08:14tux_rockercreate
2010-11-07 16:01:12tux_rockerlinkissue1990 superseder
2010-11-07 16:06:42tux_rockersetassignedto: tux_rocker
2010-11-19 10:13:46koweysetmessages: + msg13112
milestone: 2.5.0
2010-11-21 16:24:25tux_rockersetmessages: + msg13156
2010-11-21 17:17:52mornfallsetmessages: + msg13160
2010-12-10 16:32:16koweysetmilestone: 2.5.0 -> 2.5.1
2010-12-16 16:44:15koweysetmessages: + msg13356
2010-12-17 10:11:21koweysetmessages: + msg13373
2011-01-05 23:16:16ganeshsetmessages: + msg13466
milestone: 2.5.1 -> 2.5.2 STABLE
2011-01-12 14:05:58asrsetnosy: + asr
2011-06-23 16:25:03nadsetnosy: + nad
messages: + msg14549