@@ -87,38 +87,39 @@ and many other command-line options, see below.)
88Unfortunately, due to limitations in GHC, `pandoc` does not automatically
88Unfortunately, due to limitations in GHC, `pandoc` does not automatically
89detect the system's local character encoding. Hence, all input and
89detect the system's local character encoding. Hence, all input and
90−output is assumed to be in the UTF-8 encoding. If you use accented or
90+output is assumed to be in the UTF-8 encoding. If your local character
91−foreign characters, you should convert the input file to UTF-8 before
91+encoding is not UTF-8 and you use accented or foreign characters,
92−processing it with `pandoc`. This can be done by piping the input through
92+you should pipe the input and output through [`iconv`]. For example,
93−[`iconv`]: for example,
95− iconv -t utf-8 source.txt | pandoc > output.html
94+ iconv -t utf-8 source.txt | pandoc | iconv -f utf-8 > output.html
97will convert `source.txt` from the local encoding to UTF-8, then
96will convert `source.txt` from the local encoding to UTF-8, then
97+convert it to HTML, then convert back to the local encoding,
98−convert it to HTML, putting the output in `output.html`.
98+putting the output in `output.html`.
100[`iconv`]: http://www.gnu.org/software/libiconv/
100[`iconv`]: http://www.gnu.org/software/libiconv/
102−The shell scripts (described below) automatically convert the source
102+The shell scripts (described below) automatically convert the input
103−from the local encoding to UTF-8 before running them through `pandoc`.
103+from the local encoding to UTF-8 before running them through `pandoc`,
104+then convert the output back to the local encoding.
105# The shell scripts
106# The shell scripts
107For convenience, five shell scripts have been included that make it
108For convenience, five shell scripts have been included that make it
108easy to run `pandoc` without remembering all the command-line options.
109easy to run `pandoc` without remembering all the command-line options.
109−All of the scripts presuppose that `pandoc` is in the path, and
110+All of the scripts use `iconv` to convert to and from the local
111+character encoding. All of the scripts presuppose that `pandoc`
110−some have additional requirements. (For example, `html2markdown`
112+is in the path, and some have additional requirements. (For example,
111−uses `tidy`, and `markdown2pdf` uses `pdflatex`.)
113+`html2markdown` uses `tidy`, and `markdown2pdf` uses `pdflatex`.)
113−1. `markdown2html` converts markdown to HTML, running `iconv` first to
115+1. `markdown2html` converts markdown to HTML. (This can be used
114− convert the file to UTF-8. (This can be used as a replacement for
115− `Markdown.pl`.)
116+ as a replacement for `Markdown.pl`.)
1172. `html2markdown` can take either a filename or a URL as argument. If
1182. `html2markdown` can take either a filename or a URL as argument. If
118 it is given a URL, it uses `curl`, `wget`, or an available text-based
119 it is given a URL, it uses `curl`, `wget`, or an available text-based
119 browser to fetch the contents of the specified URL, then filters this
120 browser to fetch the contents of the specified URL, then filters this
120− through `tidy` to straighten up the HTML and convert to UTF-8,
121+ through `tidy` to straighten up the HTML, and finally passes
121− and finally passes this HTML to `pandoc` to produce markdown text:
122+ this HTML to `pandoc` to produce markdown text:
123 html2markdown http://www.fsf.org
124 html2markdown http://www.fsf.org
@@ -126,7 +127,7 @@ uses `tidy`, and `markdown2pdf` uses `pdflatex`.)
127 html2markdown subdir/mylocalfile.html
128 html2markdown subdir/mylocalfile.html
129−3. `latex2markdown` converts a LaTeX file to markdown.
130+3. `latex2markdown` converts a LaTeX file to markdown:
131 latex2markdown mytexfile.tex
132 latex2markdown mytexfile.tex
@@ -134,7 +135,7 @@ uses `tidy`, and `markdown2pdf` uses `pdflatex`.)
135 markdown2latex mytextfile.txt
136 markdown2latex mytextfile.txt
137−5. `markdown2pdf` converts markdown to PDF using `pdflatex`. Example:
138+5. `markdown2pdf` converts markdown to PDF using `pdflatex`:
139 markdown2pdf mytextfile.txt
140 markdown2pdf mytextfile.txt