Skip to contentSkip to conversation

The Greek letter "rho" is considered as two letters

DISCUSSION Alkis Georgopoulos 2 participants 4 messages Aug 7, 2010 – Aug 8, 2010

lore
Share & tools
lore
#1 lore raw

Erm actually this problem happens with all utf8 characters, i.e. dash does not properly take utf8 characters into account when expanding "?".

$ touch appétit              
$ ls app?tit
ls: cannot access app?tit: No such file or directory
$ ls app??tit
appétit

I'll send another mail about the greek rho problem which occurs only with redirections.

#2 lore raw

Re: ? doesn't match non-ascii characters

I've changed the title because it was misleading (was: "The Greek letter "rho" is considered as two letters").

Repeating the problem,

$ touch appétit              
$ ls app?tit
ls: cannot access app?tit: No such file or directory
$ ls app??tit
appétit

I.e. double-byte utf-8 characters need two "?" to be matched., triple-byte utf-8 characters (e.g. ἀ) need three "?" to be matched etc.

#3 lore raw
In reply to Alkis Georgopoulos
Quoted 8 lines · Alkis Georgopoulos

Erm actually this problem happens with all utf8 characters, i.e. dash does not properly take utf8 characters into account when expanding "?".

$ touch appétit              
$ ls app?tit
ls: cannot access app?tit: No such file or directory
$ ls app??tit
appétit

Yes, it seems that dash has zero support for locales. In some ways this is an advantage, as locale support can make things considerably slower and configure/startup scripts don't need it. However, it leads to inconsistent behaviour with other utilities that do support locales.

For FreeBSD's /bin/sh, which is another ash variant, I think some degree of locale support (at least for utf-8) is desirable at some point. This would include changing pattern matching and ${#var}.

I don't know what Herbert Xu thinks about this.

Signature · 1 line
Jilles Tjoelker