如何在aspell词典中使用Unicode?

6

我正在尝试使用 aspell 来检查文本中的拼写。我有一个包含例外的自定义词典。它们都是 ASCII 编码,但是有一个单词是 Unicode 编码的 (foo.en.pws):

personal_ws-1.1 en 554
Foo
bar
Bárbara

然后,我运行:

cat x.txt | aspell -a --encoding=utf-8 -p ./foo.en.pws

我得到了:
Error: ./foo.en.pws: The word "Bárbara" is invalid. 
The character '�' (U+A1) may not appear in the middle of a word.

我该怎么办?


@IgnacioVazquez-Abrams 我在那里使用 Unicode 是为了让其他人更容易通过 Google 找到这个问题。大多数人会搜索“Unicode”而不是 UTF-8。明白吗? - yegor256
1个回答

10

我通过这个页面的文档找到了一种方法。字典文件的第一行结尾必须是 utf-8

personal_ws-1.1 en 554 utf-8
Foo
bar
Bárbara

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接