Search code examples
linuxaspell

How to use Unicode in aspell dictionary?


I'm trying to use aspell to check spelling in my text. I have a custom dictionary with exceptions. They are all in ASCII, but one word is in Unicode (foo.en.pws):

personal_ws-1.1 en 554
Foo
bar
Bárbara

Then, I run:

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

And I'm getting:

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

What should I do?


Solution

  • I found a way, thanks to this documentation page. The first line of the dictionary has to have utf-8 at the end:

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