<<< Date Index >>>     <<< Thread Index >>>

Re: setting default encodings



S?ren Edzen wrote:
> * Alain Bench <messtic@xxxxxxxxx> [2005-04-20 20:33]:
> >  On Tuesday, April 19, 2005 at 8:57:18 PM +0200, S?ren Edzen wrote:
> > 
> > > * Alain Bench <messtic@xxxxxxxxx> [2005-04-13 19:54]:
> > >>| $ echo -e "\342\212\206 \342\207\222"
> > > Could it be that I use tcsh? The output on konsole is:
> > > -e \342\212\206 \342\207\222
> > 
> >     Right: echo incompatibility. Try /bin/echo.

Don't use either echo.  Use 'printf' instead.  POSIX says that echo
should interpret escape sequences by default.  But bash's echo does
not do this regardless of POSIX.  Because of this using -e with echo
is not portable from system to system.

Using 'printf' is better because it will portably interpret escape
sequences.  So I always use 'echo' if the string is plain.  But as
soon as I need an escape sequence I switch to 'printf'.

Bob