summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2003-12-05 23:50:30 +0000
committerDom Lachowicz <domlachowicz@gmail.com>2003-12-05 23:50:30 +0000
commit9f4317f6c987522fd59a0937a48d04b0dd7c8d02 (patch)
tree783fe7608768e41a2eeaf7e21d14e90c93105607
parent6bed8d5ce297b8c5e377d24cc24dd789927d7bfd (diff)
downloadenchant-9f4317f6c987522fd59a0937a48d04b0dd7c8d02.tar.gz
fix bug that was plaguing the spanish dictionaries
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@20893 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--src/ispell/ispell_checker.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/ispell/ispell_checker.cpp b/src/ispell/ispell_checker.cpp
index 0eb819f..9161ceb 100644
--- a/src/ispell/ispell_checker.cpp
+++ b/src/ispell/ispell_checker.cpp
@@ -458,7 +458,26 @@ ISpellChecker::setDictionaryEncoding( const char * hashname, const char * encodi
try_autodetect_charset(encoding);
if (g_iconv_is_valid(m_translate_in) && g_iconv_is_valid(m_translate_out))
- return; /* success */
+ {
+ /* We still have to setup prefstringchar*/
+ prefstringchar = findfiletype("utf8", 1, deftflag < 0 ? &deftflag
+ : static_cast<int *>(NULL));
+
+ if (prefstringchar < 0)
+ {
+ std::string teststring;
+ for(int n1 = 1; n1 <= 15; n1++)
+ {
+ teststring = "latin" + n1;
+ prefstringchar = findfiletype(teststring.c_str(), 1,
+ deftflag < 0 ? &deftflag : static_cast<int *>(NULL));
+ if (prefstringchar >= 0)
+ break;
+ }
+ }
+
+ return; /* success */
+ }
/* Test for UTF-8 first */
prefstringchar = findfiletype("utf8", 1, deftflag < 0 ? &deftflag : static_cast<int *>(NULL));