Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 183029 - watch(1) doesn't know and ignores unicode characters
watch(1) doesn't know and ignores unicode characters
Product: Fedora
Classification: Fedora
Component: procps (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Smetana
Brian Brock
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2006-02-25 11:39 EST by Radek Bíba
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-23 04:14:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Unicode support for watch (3.09 KB, patch)
2006-12-29 09:30 EST, Jan Cholasta
no flags Details | Diff
A more general version (3.34 KB, patch)
2007-01-16 12:15 EST, Miloslav Trmač
no flags Details | Diff

  None (edit)
Description Radek Bíba 2006-02-25 11:39:24 EST
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. tell watch to watch output of a command that produces unicode output,
reliable reproducer is e.g:
$ watch LC_ALL=ru_RU.utf8 date
(also see `LC_ALL=ru_RU.utf8 date` for comparision)
Actual results:
Where have the beautiful national characters gone?

Expected results:
I want the beautiful national characters back :)
Comment 1 Jan Cholasta 2006-12-29 09:30:48 EST
Created attachment 144544 [details]
Unicode support for watch

This patch fixes the problem. It's a little bit hacky, though. I wanted to
replace the call to getc with getwc, but the program always ended with
segmentation fault when ran, so I wrote readwc function which reads a
multi-byte character from the given stream. The problem is that it works only
with 7-bit ASCII and UTF-8 (is that really a problem?). If anyone knows how to
make getwc work, please do so.
Comment 2 Miloslav Trmač 2007-01-16 12:15:49 EST
Created attachment 145709 [details]
A more general version

This patch:
* rewrites readwc to respect LC_CTYPE.
  (getwc() can't be used because the stream returned by popen() is
* adds minimal support for multi-column characters - although it still doesn't
  seem to work quite right, see (LC_ALL=fa_IR.UTF-8 ./watch -d -n 1 date)

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