]> git.lyx.org Git - features.git/commitdiff
fix aspell encoding (confirmed on linux, cygwin and native windows,
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 11 Dec 2006 20:39:15 +0000 (20:39 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 11 Dec 2006 20:39:15 +0000 (20:39 +0000)
confirmnation on OS S is still missing)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16247 a592a061-630c-0410-9148-cb99ea01b6c8

Status.15x
src/aspell.C

index e597cfb07ec1c65c05d3183d238188d423c0c3fe..9dbe208cec79c4136775025690b61d31010d7c94 100644 (file)
@@ -66,8 +66,9 @@ SPELL CHECKING (Joost 4/11/06)
 * Words with umlauts or accents do not arrive as a whole word in the spell
   checker.
   PARTIALLY FIXED (Georg 2006-12-10): pspell should work (untested), ispell
-  works if lyxrc.isp_use_input_encoding == true. ispell (if
-  lyxrc.isp_use_input_encoding == false) and aspell do not work yet.
+  works if lyxrc.isp_use_input_encoding == true, aspell works on linux,
+  cygwin and native windows (it is not clear yet whether it works on OS X).
+  ispell (if lyxrc.isp_use_input_encoding == false) does not work yet.
 
 * The cursor does not go to the currently checked word (or maybe it goes,
   but the screen is not updated so that one does not see the word).
index 631945c24f533cb1a977646bc1d4b2b9fbd2c304..29a8f81422c5822d34f32b1ead64e3208efe08e2 100644 (file)
@@ -55,7 +55,9 @@ ASpell::~ASpell()
 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());
+       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);
@@ -87,14 +89,12 @@ ASpell::Result ASpell::check(WordLangTuple const & word)
 
        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);
@@ -112,7 +112,6 @@ void ASpell::insert(WordLangTuple const & word)
 {
        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);
 }
 
@@ -121,7 +120,6 @@ void ASpell::accept(WordLangTuple const & word)
 {
        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);
 }
 
@@ -133,7 +131,6 @@ docstring const ASpell::nextMiss()
        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());
 }