【发布时间】:2015-03-11 06:22:54
【问题描述】:
我尝试在 postgresql db 中添加俄语词典以进行全文搜索。我已经下载了 dict 文件,将它们转换为 UTF-8 并尝试创建新的 dict
$ iconv -f koi8-r -t utf-8 < ru_RU.aff > /opt/local/share/postgresql93/tsearch_data/russian.affix
$ iconv -f koi8-r -t utf-8 < ru_RU.dic > /opt/local/share/postgresql93/tsearch_data/russian.dict
CREATE TEXT SEARCH DICTIONARY russian_ispell (
TEMPLATE = ispell,
DictFile = russian,
AffFile = russian,
StopWords = russian
);
但出现错误:
ERROR: invalid byte sequence for encoding "UTF8": 0xd1
CONTEXT: line 341 of configuration file "/opt/local/share/postgresql93/tsearch_data/russian.affix": "SFX Y хаться шутся хаться"
然后尝试使用其他俄语字典,但发生了同样的错误。我该如何处理这个错误?谢谢。
【问题讨论】:
标签: postgresql dictionary utf-8 sequence cyrillic