Bug 965867 - watch does not support UTF-8 (at least not out of the box)
Summary: watch does not support UTF-8 (at least not out of the box)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: procps-ng
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaromír Cápík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 977957
TreeView+ depends on / blocked
 
Reported: 2013-05-21 21:18 UTC by Jan Pokorný [poki]
Modified: 2016-02-01 01:58 UTC (History)
2 users (show)

Fixed In Version: procps-ng-3.3.7-6.fc19
Clone Of:
: 977957 (view as bug list)
Environment:
Last Closed: 2013-05-30 17:16:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Extending configure with --enable-watch8bit (935 bytes, patch)
2013-05-22 10:23 UTC, Jan Pokorný [poki]
no flags Details | Diff

Description Jan Pokorný [poki] 2013-05-21 21:18:24 UTC
$ echo 'Příliš žluťoučký kůň úpěl ďábelské ódy' > /tmp/utf8-test
$ watch -tn5 "cat /tmp/utf8-test"
Pli luouk k pl belsk dy

It's sad to see another thing (beside [bug 801626]) with the same command
that simply works in Debian but fails in Fedora.

Admittedly, there is some relevant code (proc/escape.c), just one or more
preconditions may not be met using the distro default locale (and more or
less also the environment) as indicated by following external tests:

$ { cat <<EOF
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
    printf("MB_CUR_MAX: %d\n", MB_CUR_MAX);
}
EOF
} | gcc -xc - -o test
$ ./test
> MB_CUR_MAX: 1

(would need to be 2+?)

$ python -c 'import locale; print locale.nl_langinfo(locale.CODESET)'
> ANSI_X3.4-1968

(would need to be 'UTF-8'?)


Locale diagnostics (NB: I tried "localectl set-keymap UTF-8" prior to
                    the above test but to no effect)

$ locale
> LANG=en_US.UTF-8
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY="en_US.UTF-8"
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER="en_US.UTF-8"
> LC_NAME="en_US.UTF-8"
> LC_ADDRESS="en_US.UTF-8"
> LC_TELEPHONE="en_US.UTF-8"
> LC_MEASUREMENT="en_US.UTF-8"
> LC_IDENTIFICATION="en_US.UTF-8"
> LC_ALL=

$ localectl
>   System Locale: LANG=en_US.UTF-8
>       VC Keymap: UTF-8
>      X11 Layout: n/a

$ rpm -qf $(which watch) $(which localectl)
> procps-ng-3.3.3-4.20120807git.fc18.x86_64
> systemd-201-2.fc18.6.x86_64


Please, make UTF-8 work out-of-the-box.

Comment 1 Jan Pokorný [poki] 2013-05-22 10:23:14 UTC
Created attachment 751650 [details]
Extending configure with --enable-watch8bit

Sorry for bit of noise, I am unfamiliar with procps-ng code and did some
blind grepping.

Solution is much simpler.

Would appreciate more proactive approach regarding UTF-8 support (I am
likely barking up the wrong tree, I know).

Comment 2 Jaromír Cápík 2013-05-30 17:16:51 UTC
Successfully built and tested ... closing.

Comment 3 Fedora Update System 2013-06-26 16:54:37 UTC
procps-ng-3.3.7-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/procps-ng-3.3.7-6.fc19

Comment 4 Fedora Update System 2013-07-04 00:58:14 UTC
procps-ng-3.3.7-6.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.