mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Win-specific: Pass file names to hunspell library in local 8-bit encoding
This commit is contained in:
parent
dd84c10e2e
commit
8ad27b607b
11
hunspell.cc
11
hunspell.cc
|
@ -34,6 +34,13 @@ class HunspellDictionary: public Dictionary::Class
|
|||
string name;
|
||||
Hunspell hunspell;
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
static string Utf8ToLocal8Bit( string const & name )
|
||||
{
|
||||
return string( QString::fromUtf8( name.c_str() ).toLocal8Bit().data() );
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
/// files[ 0 ] should be .aff file, files[ 1 ] should be .dic file.
|
||||
|
@ -41,7 +48,11 @@ public:
|
|||
vector< string > const & files ):
|
||||
Dictionary::Class( id, files ),
|
||||
name( name_ ),
|
||||
#ifdef Q_OS_WIN32
|
||||
hunspell( Utf8ToLocal8Bit( files[ 0 ] ).c_str(), Utf8ToLocal8Bit( files[ 1 ] ).c_str() )
|
||||
#else
|
||||
hunspell( files[ 0 ].c_str(), files[ 1 ].c_str() )
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue