What do you think about dropping the global variable and simply calling the function "using_utf8"?static inline bool using_utf8 (void) { static bool utf8; static bool first_call = true; if (first_call) { #ifdef HAVE_LANGINFO_CODESET utf8 = (strcmp (nl_langinfo (CODESET), "UTF-8") == 0); #else utf8 = false; #endif first_call = false; } return utf8; } Hmm... I guess we have to be leery of using "bool" in dfa.c since it's slated to be shared with gawk (which lacks gnulib). So we should stick with "int" and 0/1. Either way, ACK.
Pushed with the inline function. Paolo
