From b479bfd00e463034a73a9894d4f6d87988cbc559 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 28 Sep 2015 01:09:52 +0100 Subject: DocBook: Use a fixed encoding for output Currently the encoding of documents generated by DocBook depends on the current locale. Make the output reproducible independently of the locale, by setting the encoding to UTF-8 (LC_CTYPE=C.UTF-8) by preference, or ASCII (LC_CTYPE=C) as a fallback. LC_CTYPE can normally be overridden by LC_ALL, but the top-level Makefile unsets that. Signed-off-by: Ben Hutchings [jc: added check-lc_ctype to .gitignore] Signed-off-by: Jonathan Corbet --- scripts/check-lc_ctype.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/check-lc_ctype.c (limited to 'scripts/check-lc_ctype.c') diff --git a/scripts/check-lc_ctype.c b/scripts/check-lc_ctype.c new file mode 100644 index 000000000000..9097ff5449fb --- /dev/null +++ b/scripts/check-lc_ctype.c @@ -0,0 +1,11 @@ +/* + * Check that a specified locale works as LC_CTYPE. Used by the + * DocBook build system to probe for C.UTF-8 support. + */ + +#include + +int main(void) +{ + return !setlocale(LC_CTYPE, ""); +} -- cgit v1.2.1