关于 Nutch 的一个问题: 中文乱码

| 1 Comment

很多朋友都遇到 Nutch 0.6 输入中文会出现乱码的问题。这个问题其实和 Nutch 关系不大,主要原因是使用 Tomcat 5.0 的问题。解决办法是修改 Tomcat 的 server.xml 文件的 connnector:

<Connector port="8080"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" 
    URIEncoding="UTF-8" useBodyEncodingForURI="true" /> 

其中 URIEncoding="UTF-8" useBodyEncodingForURI="true" 是需要新增的。否则搜索栏输入的字符默认编码将不能正确解析。

注:这个小 Hint 本来是写在站点的首页页面的,今天把他整理一下放到这里.

BTW: "乱码"用英语如何翻译?
  • Scrambled code/characters
  • Illegible contents/characters/codes
  • Truncated words/contents
  • Garbled character/code
  • 最后一个似乎更好

1 Comment

http://www.mozdex.com/

Mozdex is built around the Nutch Search technology