Re: watch hebrew?

2009-07-02 Thread Amos Shapira
2009/7/1 Yuval Hager yu...@avramzon.net:
 if I try to run
 $ watch echo שלום123
 I just get the '123' on the page, Hebrew characters stripped.

 man watch says:
       Non-printing characters are stripped from program output.
       Use cat -v as part of the  command  pipeline if you want to see
       them.

 but if I try
 $ watch echo שלום123|cat -v
 I get something like:
 M-WM-)M-WM-^\M-WM-^UM-WM-^]123

 Any way to idea Hebrew characters under watch?

Not a solution but a possible work-around might be a simple shell loop:

while true
do
  clear
  date
  echo 123םולש
  sleep 2
done

--Amos

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


watch hebrew?

2009-07-01 Thread Yuval Hager
if I try to run
$ watch echo שלום123
I just get the '123' on the page, Hebrew characters stripped.

man watch says:
   Non-printing characters are stripped from program output.
   Use cat -v as part of the  command  pipeline if you want to see
   them. 

but if I try
$ watch echo שלום123|cat -v
I get something like:
M-WM-)M-WM-^\M-WM-^UM-WM-^]123

Any way to idea Hebrew characters under watch?

-- 
yuval


signature.asc
Description: This is a digitally signed message part.
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: watch hebrew?

2009-07-01 Thread Dotan Cohen
 Any way to idea Hebrew characters under watch?

File a bug, it's probably a unicode issue. Non-ascii does not mean non-printing.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: watch hebrew?

2009-07-01 Thread Shachar Shemesh

Yuval Hager wrote:

if I try to run
$ watch echo שלום123
I just get the '123' on the page, Hebrew characters stripped.

man watch says:
  

  Non-printing characters are stripped from program output.
  Use cat -v as part of the  command  pipeline if you want to see
  them. 



but if I try
$ watch echo שלום123|cat -v
I get something like:
M-WM-)M-WM-^\M-WM-^UM-WM-^]123

Any way to idea Hebrew characters under watch?

  
This works for iso-8859-8 locale, but not for UTF-8 locale. I think it's 
a bug in both watch (for treating these characters as unprintables) and 
in cat (for the same reason).


I do believe they have problems dealing with multi-byte characters. I 
have nothing to suggest besides sending a bug report.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: watch hebrew?

2009-07-01 Thread Shachar Shemesh

Shachar Shemesh wrote:

Yuval Hager wrote:

if I try to run
$ watch echo שלום123
I just get the '123' on the page, Hebrew characters stripped.

man watch says:
  

  Non-printing characters are stripped from program output.
  Use cat -v as part of the  command  pipeline if you want to see
  them. 



but if I try
$ watch echo שלום123|cat -v
I get something like:
M-WM-)M-WM-^\M-WM-^UM-WM-^]123

Any way to idea Hebrew characters under watch?

  
This works for iso-8859-8 locale, but not for UTF-8 locale. I think 
it's a bug in both watch (for treating these characters as 
unprintables) and in cat (for the same reason).


I do believe they have problems dealing with multi-byte characters. I 
have nothing to suggest besides sending a bug report.


Shachar

Okay,

Narrowed it down some more.

The culprit is the use of isprint to figure out whether a character is 
printable or not. The problem is that the interface for isprint has an 
interface that makes it impossible for it to know whether the character 
is printable or not. More details can be seen at 
http://mail.nl.linux.org/linux-utf8/2002-02/msg00086.html


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il