On 11 Nov 2015 05:16, Ulrich Mueller wrote:
> >>>>> On Tue, 10 Nov 2015, Mike Frysinger wrote:
>
> > Arfrever highlights these are not even safe to use. bash is locale aware,
> > so it'll apply LC_COLLATE rules when processing the ^/, casemods. while
> > you can fix this with external programs ala:
> > LC_COLLATE=C tr ...
>
> > you can't do it with inline code like:
> > LC_COLLATE=C SRC_URI=".../${PN^^}/..."
>
> >>>>> On Tue, 10 Nov 2015, Mike Frysinger wrote:
>
> > sorry, i meant char classification here (LC_CTYPE), not collation.
>
> Shouldn't these be safe to use if the string consists purely of ASCII
> characters? I mean, A-Z and a-z should be uppercase and lowercase,
> respectively, in any locale?
nope. it depends on the order of the chars in the locale and assumes
the first is A and the last is Z. which not all do.
$ echo {a..z} | LC_ALL=et_EE.UTF-8 sed 's:[a-z]::g'
t u v w x y
we could do something like the classic:
tolower() { tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
<<<"$*"; }
but that would still would not help with the bash builtins.
-mike
signature.asc
Description: Digital signature
