Successful return code on encoding error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
One Hundred Papercuts |
New
|
Undecided
|
Unassigned | ||
html2text (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0).
Actual output:
-----------------
$ html2text test.html; echo $?
Input recoding failed due to invalid input sequence. Unconverted part of text follows.
“Test”)
</body>
</html>
0
Expected output: (substitute 1 for any appropriate failure code)
-------
$ html2text test.html; echo $?
Input recoding failed due to invalid input sequence. Unconverted part of text follows.
“Test”)
</body>
</html>
1
This seem to have been introduced by 611-recognize-
OS: Ubuntu 14.04 / Ubuntu 16.04
Package: html2text-1.3.2a-17 / html2text-1.3.2a-18
Quick method to test: /launchpadlibra rian.net/ 250515419/ test.html | html2text; echo $?
sudo apt-get install html2text
curl -s https:/