Bug 965867 - watch does not support UTF-8 (at least not out of the box)
watch does not support UTF-8 (at least not out of the box)
Product: Fedora
Classification: Fedora
Component: procps-ng (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jaromír Cápík
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks: 977957
  Show dependency treegraph
Reported: 2013-05-21 17:18 EDT by Jan Pokorný
Modified: 2016-01-31 20:58 EST (History)
2 users (show)

See Also:
Fixed In Version: procps-ng-3.3.7-6.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 977957 (view as bug list)
Last Closed: 2013-05-30 13:16:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Jan Pokorný 2013-05-21 17:18:24 EDT
$ 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);
} | gcc -xc - -o test
$ ./test

(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_TIME="en_US.UTF-8"
> LC_PAPER="en_US.UTF-8"
> LC_NAME="en_US.UTF-8"

$ 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ý 2013-05-22 06:23:14 EDT
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 13:16:51 EDT
Successfully built and tested ... closing.
Comment 3 Fedora Update System 2013-06-26 12:54:37 EDT
procps-ng-3.3.7-6.fc19 has been submitted as an update for Fedora 19.
Comment 4 Fedora Update System 2013-07-03 20:58:14 EDT
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.