2019-02-23 00:46:31 -08:00
|
|
|
#include "CharEncodingConverter.h"
|
2016-01-06 03:35:13 -08:00
|
|
|
|
2016-05-16 23:54:43 -07:00
|
|
|
#include "build_config.h"
|
2016-01-06 03:35:13 -08:00
|
|
|
|
2019-02-23 00:46:31 -08:00
|
|
|
#include <iostream>
|
|
|
|
#ifdef USE_ICONV
|
2016-01-06 03:35:13 -08:00
|
|
|
#include "CharEncodingConverterIConv.h"
|
|
|
|
#endif
|
|
|
|
|
2019-02-23 00:46:31 -08:00
|
|
|
CharEncodingConverter *CharEncodingConverter::createStandardConverter(const std::string &to, const std::string &from)
|
2016-01-06 03:35:13 -08:00
|
|
|
{
|
2019-02-23 00:46:31 -08:00
|
|
|
#ifdef USE_ICONV
|
2016-01-06 03:35:13 -08:00
|
|
|
return new CharEncodingConverterIConv(to, from);
|
2019-02-23 00:46:31 -08:00
|
|
|
#else
|
2016-01-06 03:35:13 -08:00
|
|
|
return new CharEncodingConverterDummy(to, from);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string CharEncodingConverter::getCurrentCharEncoding(void)
|
|
|
|
{
|
2019-02-23 00:46:31 -08:00
|
|
|
#ifdef USE_ICONV
|
2016-01-06 03:35:13 -08:00
|
|
|
return CharEncodingConverterIConv::getCurrentCharEncoding();
|
2019-02-23 00:46:31 -08:00
|
|
|
#else
|
2016-01-06 03:35:13 -08:00
|
|
|
return CharEncodingConverterDummy::getCurrentCharEncoding();
|
|
|
|
#endif
|
|
|
|
}
|