UTF-8字符显示不正确 [英] UTF-8 characters not showing properly

查看:122
本文介绍了UTF-8字符显示不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Nutch 1.4和solr 3.3.0来抓取我的法文网站并将其编入索引.我的站点曾经在iso8859-1中.

I am using Nutch 1.4 and solr 3.3.0 to crawl and index my site which is in French. My site used to be in iso8859-1.

目前,我在solr下有2个索引.在第一个页面中,我存储了我的旧页面(在iso8859-1中),在第二个页面中,我存储了我的新页面(在utf-8中).

Currently I have 2 indexes under solr. In the first one I store my old pages (in iso8859-1) and in the second one I store my new pages (in utf-8).

我对两个爬网作业使用相同的配置配置来获取和索引网站上的旧页面和新页面.我还没有自己添加任何有关宪章编码的设置.(我认为).

I use the same nutch configurations for both of the crawl jobs to get and index the old and the new pages on my site. I have not added any settings about charters encodings on my own ( i think).

在搜索应该在utf-8中的新页面时,我遇到了问题.法语字符无法正确显示.但是对于iso8859-1中的旧页面,一切似乎都很好.

I am facing problem when searching the new pages thats supposed to be in utf-8. The french characters doesn't display properly. But for the old pages thats in iso8859-1 everything seems to be fine.

我想知道是否有人可以指出正确的方向来解决此问题.

I was wondering if anyone could point me in the right direction for fixing this problem.

我相信问题出在问题上,因为当我创建段的转储时,我在转储文件中看到了那些有趣的字符.

I believe the problem comes from the nutch since when I created the dump of the segments I saw those funny character in the dump file.

谢谢.

推荐答案

在nutch-default.xml中,应相应地设置"parser.character.encoding.default"值.您只需要将其设置为utf-8.默认值为"windows-1252".

In nutch-default.xml "parser.character.encoding.default" value should be set accordingly. You just have to set it to utf-8. Its default value is "windows-1252".

这篇关于UTF-8字符显示不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆