Date: Tue, 19 Jan 2010 21:00:20 GMT From: Yuri Pankov <yuri.pankov@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/142986: /dev/random can not be source for tr(1) | tr: Illegal byte sequence Message-ID: <201001192100.o0JL0KSx040498@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/142986; it has been noted by GNATS. From: Yuri Pankov <yuri.pankov@gmail.com> To: vermaden <vermaden@interia.pl> Cc: bug-followup@freebsd.org Subject: Re: bin/142986: /dev/random can not be source for tr(1) | tr: Illegal byte sequence Date: Tue, 19 Jan 2010 23:51:00 +0300 /dev/random just isn't guaranteed to produce correct multibyte characters (and I guess you are using multibyte locale). Try setting LC_CTYPE to single byte locale: > locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_ALL= > head -c 200 /dev/urandom | tr -c -d 'A-Za-z0-9' tr: Illegal byte sequence > head -c 200 /dev/urandom | env LC_CTYPE=C tr -c -d 'A-Za-z0-9' myRUBav1EHfJrD0HCSuurHRPYmqMPzWErJhHRgp6ze0YisDoA4x
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001192100.o0JL0KSx040498>