[PATCH] test-encode: Use tr chacter classes instead of character ranges

Dan Villiom Podlaski Christiansen danchr at gmail.com
Sun Jan 24 04:51:28 CST 2010


On 24 Jan 2010, at 01:05, Mads Kiilerich wrote:

> I'm not sure about the facts, but I guess some kind of story is necessary...
> 
> Solaris tr doesn't understand 'a-z' but wants it like '[a-z]'. Other implementations (old GNU?) do however not understand '[a-z]' (even though it seems to work accidentially).
> 
> The upper/lower character classes seems work and is documented on "all" (for all < 3) platforms.

It probably won't matter in this instance as it's in a test, but one other difference is that '[:lower:]' is locale-aware, and matches characters such as æ, ø, å, é, ü, ö, ä and so on. The same goes with '[:upper:]', of course…

--

Dan Villiom Podlaski Christiansen
danchr at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1943 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100124/f72c25f0/attachment.bin>


More information about the Mercurial-devel mailing list