Pádraig Brady <p...@draigbrady.com> writes: >> if (STREQ_OPT (locale_charset (), "ASCII", >> 'A', 'S', 'C', 'I', 'I', 0, 0, 0, 0)) >> fold_file (...) >> else >> fold_file_multibyte (...) > > Ideally as little would be duplicated as possible, > but yes that's one way to address the issue. > Note there is a hard_locale(LC_CTYPE) abstraction to detect this.
CC'ing Bruno since this seems up his alley. My understanding is that hard_locale checks whether the locale is "C" or "POSIX" not the character set in use. On some systems like Haiku when you do LC_ALL=C you are using UTF-8. Side note, that is annoying thing about Haiku since Coreutils test suite will fail in many places there only because ‘...’ is used instead of '...'. Having the test suite handle that would be a chore... Collin