mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +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) {
|
||||
#ifdef HAVE_ICU
|
||||
if ( !converter) converter = ucnv_open("utf-8", &status);
|
||||
#endif
|
||||
str = input;
|
||||
}
|
||||
|
||||
IfcCharacterEncoder::~IfcCharacterEncoder() {
|
||||
#ifdef HAVE_ICU
|
||||
if ( !converter) ucnv_close(converter);
|
||||
converter = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
IfcCharacterEncoder::operator std::string() {
|
||||
|
||||
@@ -77,10 +77,10 @@ namespace IfcWrite {
|
||||
|
||||
class IfcCharacterEncoder {
|
||||
private:
|
||||
std::string str;
|
||||
#ifdef HAVE_ICU
|
||||
static UErrorCode status;
|
||||
static UConverter* converter;
|
||||
std::string str;
|
||||
#endif
|
||||
public:
|
||||
IfcCharacterEncoder(const std::string& input);
|
||||
|
||||
Reference in New Issue
Block a user