@alister
Very good explanation and example.
If it can be explained by a simple change of environment that's brilliant. I'd forgotten about certain Linux using UTF-8 and some of the other consequences like really slow sort, grep, sed etc. . There are many advantages of UTF-8/UTF-16/UTF-nn in the Word Processing world but I can't see any advantage on the default command line.
As you will all know I'm a bit of a Posix cynic (though I support the Posix ideal) mainly because I come across too many non-compliant situations. I have lost track of the "current Posix standard" (despite @jlliagre's best efforts).
I'm not sure that the Original Post is 100% one of those situations because the O/P noticed that what I believed was the portable syntax worked. The Linux/BSD amomaly with the treatment of quoted square brackets in the
tr command is in my opinion a coding error.
Quote:
The \[ and \] escape sequences are undefined in POSIX. Their use is not portable.
Not sure if that quote in context because this is nothing to do with Escape Sequences (like for Printer control). If it is, then IMHO that Posix standard needs urgent correction. It's universally expected in unix syntax that a character which is part of the syntax of a command must be escaped if it is to be considered as data.