Bug 30083 - Cyrillic letters not printed in the output of some cmds
Summary: Cyrillic letters not printed in the output of some cmds
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: ghc7.6.1-darcs (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Denis Smirnov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-19 01:47 MSK by Ivan Zakharyaschev
Modified: 2014-05-25 15:15 MSK (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2014-05-19 01:47:46 MSK
ghc7.6.1-darcs-2.8.4-alt2

In the output of some commands Cyrillic letters are not printed as is, but rather as codes, so they are not readable. (Although the locale is Cyrillic.)

$ darcs init
$ echo Здравствуйте > hello.txt
$ darcs add -r .
$ darcs wh 
addfile ./hello.txt
hunk ./hello.txt 1
+<U+00D0><U+0097><U+00D0><U+00B4><U+00D1><U+0080><U+00D0><U+00B0><U+00D0><U+00B2><U+00D1><U+0081><U+00D1><U+0082><U+00D0><U+00B2><U+00D1><U+0083><U+00D0><U+00B9><U+00D1><U+0082><U+00D0><U+00B5>
$ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
$ 

As far as I remember, this wasn't like this in some previous version of darcs, probably 2.1.2-alt2 -- http://packages.altlinux.org/en/Platform5/srpms/darcs .

Perhaps, there are other commands where this happens, and I'll report them later.
Comment 1 Ivan Zakharyaschev 2014-05-19 04:15:16 MSK
Workaround: use "darcs diff", which uses the external diff tool (and hence is slower):

$ darcs diff
diff -rN -u old-darcs-Cyr/hello.txt new-darcs-Cyr/hello.txt
--- old-darcs-Cyr/hello.txt	1970-01-01 03:00:00.000000000 +0300
+++ new-darcs-Cyr/hello.txt	2014-05-19 04:11:15.678289159 +0400
@@ -0,0 +1 @@
+Здравствуйте
$ 

From the manpage:

...

           By default, `darcs whatsnew' uses Darcs' internal format for changes.  To see some context (unchanged lines) around  each  change,
           use the --unified option.  To view changes in conventional `diff' format, use the `darcs diff' command; but note that `darcs what‐
           snew' is faster.

...

       darcs diff [file|directory]...
           The  `darcs  diff'  command  compares  two  versions of the working tree of the current repository.  Without options, the pristine
           (recorded) and unrecorded working trees are compared.  This is lower-level than the `darcs whatsnew' command, since it  outputs  a
           line-by-line  diff,  and it is also slower.  As with `darcs whatsnew', if you specify files or directories, changes to other files
           are not listed.  The command always uses an external diff utility.

...
Comment 2 Ivan Zakharyaschev 2014-05-19 04:21:30 MSK
Also the Cyrillic letters in the output of "darcs whatsnew" generate soem strange garbage around them on dumb terminals:

$ echo world > world.txt
$ darcs add world.txt 
$ darcs wh | cat
addfile ./hello.txt
hunk ./hello.txt 1
+[_<U+00D0>_][_<U+0097>_][_<U+00D0>_][_<U+00B4>_][_<U+00D1>_][_<U+0080>_][_<U+00D0>_][_<U+00B0>_][_<U+00D0>_][_<U+00B2>_][_<U+00D1>_][_<U+0081>_][_<U+00D1>_][_<U+0082>_][_<U+00D0>_][_<U+00B2>_][_<U+00D1>_][_<U+0083>_][_<U+00D0>_][_<U+00B9>_][_<U+00D1>_][_<U+0082>_][_<U+00D0>_][_<U+00B5>_]
addfile ./world.txt
hunk ./world.txt 1
+world
$ 

Perhaps, this are the colored highlighting for these codes (they are printed red)... but this garbage doesn't appear around other highlighted text; for example, above the words "addfile"and"hunk"are printed in blue in a terminal.
Comment 3 Ivan Zakharyaschev 2014-05-25 15:15:40 MSK
Reported upstream: 
* http://bugs.darcs.net/issue2389
* http://bugs.darcs.net/issue2391