Currently the file list supplied via --files-from is split at each line feed \n:
|
if (options['files-from']) { |
|
input = fs.readFileSync(options['files-from'], options['from-code']) |
|
.split('\n') |
|
.filter(function (line) { |
|
return line.trim().length > 0; |
|
}); |
|
} |
This leads to problems with lists generated by programs that produce "Windows linebreaks" (CR LF, \r\n).
This is why I suggest changing the current behaviour and making line splitting work like in GNU gettext: https://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/src/file-list.c?id=b26729c67cffb2403d8a20b44606f5a08cb901b5#n68
What is done is basically this:
- Get next line from the file.
- Remove trailing new line
\n
- Remove any of: Tab
\t, space (I'm not sure this is actually a good idea) and \r from the end of the string.
Currently the file list supplied via
--files-fromis split at each line feed\n:xgettext/index.js
Lines 195 to 201 in 2a23cf5
This leads to problems with lists generated by programs that produce "Windows linebreaks" (CR LF,
\r\n).This is why I suggest changing the current behaviour and making line splitting work like in GNU gettext: https://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/src/file-list.c?id=b26729c67cffb2403d8a20b44606f5a08cb901b5#n68
What is done is basically this:
\n\t, space (I'm not sure this is actually a good idea) and\rfrom the end of the string.