mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 20:00:02 +00:00
Fix compilation errors of IfcCharacterEncoder in case ICU is not available
This commit is contained in:
@@ -300,13 +300,17 @@ char IfcCharacterDecoder::substitution_character = '_';
|
|||||||
|
|
||||||
|
|
||||||
IfcCharacterEncoder::IfcCharacterEncoder(const std::string& input) {
|
IfcCharacterEncoder::IfcCharacterEncoder(const std::string& input) {
|
||||||
|
#ifdef HAVE_ICU
|
||||||
if ( !converter) converter = ucnv_open("utf-8", &status);
|
if ( !converter) converter = ucnv_open("utf-8", &status);
|
||||||
|
#endif
|
||||||
str = input;
|
str = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfcCharacterEncoder::~IfcCharacterEncoder() {
|
IfcCharacterEncoder::~IfcCharacterEncoder() {
|
||||||
|
#ifdef HAVE_ICU
|
||||||
if ( !converter) ucnv_close(converter);
|
if ( !converter) ucnv_close(converter);
|
||||||
converter = 0;
|
converter = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
IfcCharacterEncoder::operator std::string() {
|
IfcCharacterEncoder::operator std::string() {
|
||||||
|
|||||||
@@ -77,10 +77,10 @@ namespace IfcWrite {
|
|||||||
|
|
||||||
class IfcCharacterEncoder {
|
class IfcCharacterEncoder {
|
||||||
private:
|
private:
|
||||||
|
std::string str;
|
||||||
#ifdef HAVE_ICU
|
#ifdef HAVE_ICU
|
||||||
static UErrorCode status;
|
static UErrorCode status;
|
||||||
static UConverter* converter;
|
static UConverter* converter;
|
||||||
std::string str;
|
|
||||||
#endif
|
#endif
|
||||||
public:
|
public:
|
||||||
IfcCharacterEncoder(const std::string& input);
|
IfcCharacterEncoder(const std::string& input);
|
||||||
|
|||||||
Reference in New Issue
Block a user