On Mon, Mar 30, 2015 at 08:50:11AM -0700, Evan Gates wrote: > The problem is using glibc's regex engine without first calling > setlocale to ensure a UTF-8 locale. This causes it to remain in the > C/POSIX locale. This will effect the same problem in all tools that > use the libc's regex engine (expr, grep, nl, sed). No good clean > solution comes to mind yet, I'll keep thinking about it. Any ideas? >
How about simply calling setlocale()? Or was that too simple? If the user has set a non-UTF-8 locale and then uses UTF-8, that's on them! > -emg >