Update of bug#65199 (group groff): Severity: 3 - Normal => 1 - Wish Status: None => Rejected Assigned to: None => gbranden Open/Closed: Open => Closed
_______________________________________________________ Follow-up Comment #1: [comment #0 original submission:] > Subject: deprecate the option '-k' on the command line > > The option '-k' is superfluous, > > 1) the input file must be readable > > 2) thus the encoding can be found Incorrect. (2) does not follow from (1). Read the _preconv_(1) man page. iconv support While preconv recognizes all of the coding tags listed above, it is capable on its own of interpreting only three encodings: Latin‐1, code page 1047, and UTF‐8. If iconv support is configured at compile time and available at run time, all others are passed to iconv library functions, which may recognize many additional encoding strings. The command “preconv -v” discloses whether iconv support is configured. If a user's _groff_ build lacks a sufficiently capable _iconv_(3) implementation, then an encoding will not necessarily be correctly deduced. > 3) '-k' is unnecessary used to find the encoding that can > already be found and used There is more of the _preconv_(1) man page that you appear not to have read. The use of iconv means that characters in the input that encode invalid code points for that encoding may be dropped from the output stream or mapped to the Unicode replacement character (U+FFFD). Compare the following examples using the input “café” (note the “e” with an acute accent), which due to its short length challenges inference of the encoding used. printf 'caf\351\n' | LC_ALL=en_US.UTF-8 preconv printf 'caf\351\n' | preconv -e us-ascii printf 'caf\351\n' | preconv -e latin-1 The fate of the accented “e” differs in each case. In the first, uchardet fails to detect an encoding (though the library on your system may behave differently) and preconv falls back to the locale settings, where octal 351 starts an incomplete UTF‐8 sequence and results in the Unicode replacement character. In the second, it is not a representable character in the declared input encoding of US‐ASCII and is discarded by iconv. In the last, it is correctly detected and mapped. > 4) the preconv is used every time to find the encoding of the file > when used as an input file, which is a waste of resources. No. _preconv_(1) is not run unconditionally by _groff_, but only when demanded by the `-k` or `-K` options. > Actions: > > 1) man pages need to announce that '-k' is deprecated and '-K > <encoding>' should be used instead > > 2) the scripts "groff" and "nroff" should announce the same as the > man pages > > 3) other commands that accept the '-k' option should do the same. I disagree with all of this. Closing as rejected. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?65199> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/