2014-05-22 16:53:06 +00:00
|
|
|
/* This file is (c) 2014 Abs62
|
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#include "epwing_charmap.hh"
|
|
|
|
|
|
|
|
namespace Epwing {
|
|
|
|
|
|
|
|
EpwingCharmap & EpwingCharmap::instance()
|
|
|
|
{
|
|
|
|
static EpwingCharmap ec;
|
|
|
|
return ec;
|
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray EpwingCharmap::mapToUtf8( QString const & code )
|
|
|
|
{
|
|
|
|
if( charMap.contains( code ) )
|
|
|
|
return QString( charMap[ code ] ).toUtf8();
|
|
|
|
|
|
|
|
return QByteArray();
|
|
|
|
}
|
|
|
|
|
2022-02-27 05:17:37 +00:00
|
|
|
void EpwingCharmap::addEntry( QString const & code, int ch )
|
2014-05-22 16:53:06 +00:00
|
|
|
{
|
2022-02-27 05:17:37 +00:00
|
|
|
charMap[ code ] = QChar(ch);
|
2014-05-22 16:53:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Epwing
|