by default use utf-8 for metadata including non-ascii characters while missing codepage info

This commit is contained in:
Mario Fink 2024-06-12 12:02:26 +02:00
parent 25e114dbea
commit eec3853af9

View File

@ -496,18 +496,10 @@ 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
cpn = std::string("CP") + codepage_; std::string cpn = std::string("CP") + codepage_;
}
else {
// assume codepage 1252 by default
cpn = std::string("CP1252");
}
// set up converter // set up converter
std::string utf = std::string("UTF-8"); std::string utf = std::string("UTF-8");
@ -526,6 +518,7 @@ namespace imc
conv.convert(group_name_); conv.convert(group_name_);
conv.convert(group_comment_); conv.convert(group_comment_);
} }
}
// get info string // get info string
std::string get_info(int width = 20) std::string get_info(int width = 20)