goldendict-ng/src/dict/epwing_charmap.cc

28 lines
538 B
C++
Raw Normal View History

/* 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 )
{
2022-02-27 05:17:37 +00:00
charMap[ code ] = QChar(ch);
}
} // namespace Epwing