Compare commits
3 Commits
v2.0.15
...
8cde88848b
Author | SHA1 | Date | |
---|---|---|---|
8cde88848b | |||
0799513ea2 | |||
effeee105c |
@@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
[](https://lgtm.com/projects/g/RecordEvolution/IMCtermite/alerts/)
|
|
||||||
[](https://lgtm.com/projects/g/RecordEvolution/IMCtermite/context:cpp)
|
|
||||||
[](https://lgtm.com/projects/g/RecordEvolution/IMCtermite/context:python)
|
|
||||||
[](https://img.shields.io/github/license/RecordEvolution/IMCtermite)
|
[](https://img.shields.io/github/license/RecordEvolution/IMCtermite)
|
||||||
[](https://img.shields.io/github/stars/RecordEvolution/IMCtermite)
|
[](https://img.shields.io/github/stars/RecordEvolution/IMCtermite)
|
||||||

|

|
||||||
|
[](https://pypi.org/project/IMCtermite/)
|
||||||
|
|
||||||
# IMCtermite
|
# IMCtermite
|
||||||
|
|
||||||
|
@@ -12,6 +12,8 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#if defined(__linux__) || defined(__APPLE__)
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
#elif defined(__WIN32__) || defined(_WIN32)
|
||||||
|
#define timegm _mkgmtime
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//---------------------------------------------------------------------------//
|
//---------------------------------------------------------------------------//
|
||||||
@@ -494,28 +496,35 @@ namespace imc
|
|||||||
// convert any description, units etc. to UTF-8 (by default)
|
// convert any description, units etc. to UTF-8 (by default)
|
||||||
void convert_encoding()
|
void convert_encoding()
|
||||||
{
|
{
|
||||||
|
// actual input codepage
|
||||||
|
std::string cpn;
|
||||||
|
|
||||||
if ( !codepage_.empty() )
|
if ( !codepage_.empty() )
|
||||||
{
|
{
|
||||||
// construct iconv-compatible name for respective codepage
|
// construct iconv-compatible name for respective codepage
|
||||||
std::string cpn = std::string("CP") + codepage_;
|
cpn = std::string("CP") + codepage_;
|
||||||
|
|
||||||
// set up converter
|
|
||||||
std::string utf = std::string("UTF-8");
|
|
||||||
iconverter conv(cpn,utf);
|
|
||||||
|
|
||||||
conv.convert(name_);
|
|
||||||
conv.convert(comment_);
|
|
||||||
conv.convert(origin_);
|
|
||||||
conv.convert(origin_comment_);
|
|
||||||
conv.convert(text_);
|
|
||||||
conv.convert(language_code_);
|
|
||||||
conv.convert(yname_);
|
|
||||||
conv.convert(yunit_);
|
|
||||||
conv.convert(xname_);
|
|
||||||
conv.convert(xunit_);
|
|
||||||
conv.convert(group_name_);
|
|
||||||
conv.convert(group_comment_);
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// assume codepage 1252 by default
|
||||||
|
cpn = std::string("CP1252");
|
||||||
|
}
|
||||||
|
|
||||||
|
// set up converter
|
||||||
|
std::string utf = std::string("UTF-8");
|
||||||
|
iconverter conv(cpn,utf);
|
||||||
|
|
||||||
|
conv.convert(name_);
|
||||||
|
conv.convert(comment_);
|
||||||
|
conv.convert(origin_);
|
||||||
|
conv.convert(origin_comment_);
|
||||||
|
conv.convert(text_);
|
||||||
|
conv.convert(language_code_);
|
||||||
|
conv.convert(yname_);
|
||||||
|
conv.convert(yunit_);
|
||||||
|
conv.convert(xname_);
|
||||||
|
conv.convert(xunit_);
|
||||||
|
conv.convert(group_name_);
|
||||||
|
conv.convert(group_comment_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get info string
|
// get info string
|
||||||
|
@@ -1 +1 @@
|
|||||||
2.0.15
|
2.0.16
|
||||||
|
Reference in New Issue
Block a user