|
From: | Paul Eggert |
Subject: | Re: commit-msg hook |
Date: | Tue, 14 Apr 2015 10:42:53 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 04/14/2015 10:09 AM, Eli Zaretskii wrote:
This sort of thing should work in a unibyte environment, but it needs to >be used only after testing that we actually are in a unibyte environment.I thought that's what all the tests with cent_sign and at_sign do, don't they?
No, they test for something more specific, namely, whether we're in a UTF-8 locale. Not every multibyte locale uses UTF-8.
I suppose it could cause the script to print "Unprintable character in commit message" even though all the message's characters are actually printable.what bad things could happen if this regular expression is used in a multibyte environment?
How about this idea? Before falling back to the unibyte regular expressions in awk, set LC_ALL='C' in the environment. This should work well enough, as in practice all environments where the C locale is multibyte have working UTF-8 so they won't need to fall back to unibyte anyway.
[Prev in Thread] | Current Thread | [Next in Thread] |