void ASpell::addSpeller(string const & lang)
{
AspellConfig * config = new_aspell_config();
+ // FIXME The aspell documentation says to use "lang"
aspell_config_replace(config, "language-tag", lang.c_str());
+ // Set the encoding to utf-8.
+ // aspell does also understand "ucs-4", so we would not need a
+ // conversion in theory, but if this is used it expects all
+ // char const * arguments to be a cast from uint const *, and it
+ // seems that this uint is not compatible with our char_type on some
+ // platforms (cygwin, OS X). Therefore we use utf-8, that does
+ // always work.
+ aspell_config_replace(config, "encoding", "utf-8");
AspellCanHaveError * err = new_aspell_speller(config);
if (spell_error_object)
delete_aspell_can_have_error(spell_error_object);
AspellSpeller * m = it->second.speller;
- // FIXME UNICODE: we don't need to convert to UTF8, but probably to the locale encoding
int const word_ok = aspell_speller_check(m, to_utf8(word.word()).c_str(), -1);
BOOST_ASSERT(word_ok != -1);
if (word_ok) {
res = OK;
} else {
- // FIXME UNICODE: we don't need to convert to UTF8, but probably to the locale encoding
AspellWordList const * sugs =
aspell_speller_suggest(m, to_utf8(word.word()).c_str(), -1);
BOOST_ASSERT(sugs != 0);
{
Spellers::iterator it = spellers_.find(word.lang_code());
if (it != spellers_.end())
- // FIXME UNICODE: we don't need to convert to UTF8, but probably to the locale encoding
aspell_speller_add_to_personal(it->second.speller, to_utf8(word.word()).c_str(), -1);
}
{
Spellers::iterator it = spellers_.find(word.lang_code());
if (it != spellers_.end())
- // FIXME UNICODE: we don't need to convert to UTF8, but probably to the locale encoding
aspell_speller_add_to_session(it->second.speller, to_utf8(word.word()).c_str(), -1);
}
if (els)
str = aspell_string_enumeration_next(els);
- // FIXME UNICODE: str is not in UTF8, but probably the locale encoding
return (str ? from_utf8(str) : docstring());
}