Description of problem: SSIA Version-Release number of selected component (if applicable): procps-3.2.6-3.2 How reproducible: Always 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 :)
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.
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 byte-oriented). * 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)