1

I'm making a script which uses html2text, however, it can't handle non-English letters. I'd like to use letters such as á, é í, ó ú, æ, ø, ö, ä, ð, þ. It just shows questions marks instead of the intended letters, and I have tried tidy but it just doesn't work the same way, so it's not something I'd like to use for this script.

  • I found two html2text tools, one written in Python another in C++ ... which one do you use. – Scantlight Nov 2 '15 at 17:58
  • Don't know what it's built in but according to the man page, "Arno Unkrig" and "Martin Bayer" wrote it. – DisplayName Nov 2 '15 at 18:15
  • @Scanlight after further research, it's not the Python one. – DisplayName Nov 2 '15 at 18:30
  • yes, it's the one written in C++. – Scantlight Nov 2 '15 at 20:15
2

Add -utf8 and -nobs, it will be able to display special letters.

  • -utf8 is not described in documentation but it's good if it works :) could you write more description / info about this options to make a complete answer? – Scantlight Nov 2 '15 at 20:30
  • -nobs Do not use backspaces for boldface and underlining -ascii Use plain ASCII for output instead of ISO-8859-1 -utf8 Assume both terminal and input stream are in UTF-8 mode – Carson Ip May 16 '18 at 15:17
  • Debian version of html2text also can do input and output recoding (see /usr/share/doc/html2text/README.Debian for more info). html2text tries to fetch encoding from HTML document. If encoding is not specified, you can use -ascii and -utf8 options. Output is converted to user's locale charset (LC_CTYPE). – Carson Ip May 17 '18 at 2:33
  • The original html2text doesn't have it. It is the debian version that contains all the goodies. – Carson Ip May 17 '18 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.