gettext
4cacad44 - xgettext: Protect file names with spaces through Unicode U+2068, U+2069.

Commit
3 years ago
xgettext: Protect file names with spaces through Unicode U+2068, U+2069. * gettext-tools/src/pos.h: Include <stdbool.h>. (pos_filename_has_spaces): New declaration. * gettext-tools/src/pos.c: New file. * gettext-tools/src/msgl-ofn.h: New file. * gettext-tools/src/msgl-ofn.c: New file. * gettext-tools/src/FILES: Update. * gettext-tools/src/Makefile.am (noinst_HEADERS): Add msgl-ofn.h. (COMMON_SOURCE): Add pos.c. (libgettextsrc_la_SOURCES): Add msgl-ofn.c. * gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Likewise. * gettext-tools/src/write-catalog.h (struct catalog_output_format): Add field requires_utf8_for_filenames_with_spaces. * gettext-tools/src/xgettext.c: Include pos.h, msgl-ofn.h. (finalize_header): Convert the message domain to UTF-8 also when some message has file names with spaces. * gettext-tools/src/write-po.h (message_print_comment_filepos): Add charset parameter. * gettext-tools/src/write-po.c: Include pos.h. (message_print_comment_filepos): Add charset parameter. If a file name has spaces, enclose it in U+2068 and U+2069 characters. (message_print, message_print_obsolete, output_format_po): Update. * gettext-tools/src/write-properties.c (write_message, output_format_properties): Update. * gettext-tools/src/write-stringtable.c (output_format_stringtable): Update. * gettext-tools/tests/xgettext-17: New file. * gettext-tools/tests/Makefile.am (TESTS): Add it.
Author
Committer
Parents
Loading