osx-snow-leopard - 我如何解决 : pandoc: . ..:hGetContents: invalid argument (invalid byte sequence)

标签 osx-snow-leopard pandoc

我在 Mac OSX 10.6.8 的终端中运行以下代码:
find . -name \*.html -type f -exec pandoc -o {}.md {} \;
它解析了一些文档,但在很多文档上给了我这个错误:
pandoc: ./Teaching/how_16825_make-lesson-book.html: hGetContents: invalid argument (invalid byte sequence)
知道如何解决这个问题吗?

最佳答案

有同样的问题我也看到这是在 Pandoc README.html 文件中:---

Pandoc uses the UTF-8 character encoding for both input and output. If your local character encoding is not UTF-8, you should pipe input and output through iconv:

iconv -t utf-8 input.txt | pandoc | iconv -f utf-8


当然,您可能需要先安装 iconv (我相信 Mac Osx 已经有了它)......

http://gnuwin32.sourceforge.net/packages/libiconv.htm Gnu Win32

https://code.google.com/p/win-iconv/ Google Win-Iconv

关于osx-snow-leopard - 我如何解决 : pandoc: . ..:hGetContents: invalid argument (invalid byte sequence),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10358508/

相关文章:

pandoc - 如何更改 pandoc 的 markdown 到 html 转换的输出

python - 为什么我的 Snow Leopard 在/usr/bin 中安装了这么多 Python?是什么决定了哪一个是系统Python?

iphone - Xcode 4 和 iOS SDK 4.3 是否与 Snow Leopard 兼容?

Mac 10.6.3 上 xcode 3.2.3 安装失败

string - Pandoc过滤器pandoc.Para Lua函数中的字符转义

latex - 当使用 pandoc 从 markdown 转换为 latex 时,波浪号超过 n

objective-c - API 文档 : LSOpenURLsWithRole()

python - 更改 distutils 使用的 gcc 版本

html - 如何通过 CSS 将 header 添加到 HTML 页面?

latex - pandoc LaTex 添加 CSS 创建 PDF