tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: vi vs. nvi



On 1218110948 seconds since the Beginning of the UNIX epoch
SODA Noriyuki wrote:
>
>>>>>> On Wed, 06 Aug 2008 15:16:53 -0400,
>       "Perry E. Metzger" <perry%piermont.com@localhost> said:
>
>>>> Are there plans to get a wchar_t-capable regex into libc?
>>> 
>>> Not on my side, at least. It would be nice to wait until it's
>>> standardized somehow or at least until another application needs it.
>
>> I was under the impression that there were reasonably standard ways to
>> do the API at this point. Am I mistaken?
>
>The standard way is to use regcomp()/regexec() functions against
>multibyte strings (instead of using wide character strings). 
>The regex functions should honor current locale, but NetBSD
>implementation currently doesn't.

I'm not sure that I like this as a default.  You get all manner of
lossage on Linux because of this.  I.e. [a-z] in the en_US locale
matches all characters except for capital A because of the collation
order.  And on a typical Linux system about half of the system
tools will do this.  The only reasonable option is to unset the
locale at the beginning of every script or it may malfunction in
rather odd ways w.r.t. regex's and globbing.

--
    Roland Dowdeswell                      http://www.Imrryr.ORG/~elric/


Home | Main Index | Thread Index | Old Index