diff --git a/src/core/charset/charset.c b/src/core/charset/charset.c index 9e68cd8..8482a5f 100644 --- a/src/core/charset/charset.c +++ b/src/core/charset/charset.c @@ -219,6 +219,12 @@ LIB3270_EXPORT void lib3270_reset_charset(H3270 *hSession, const char * host, co #define replace_pointer(x,v) if(x) { lib3270_free(x); }; x = strdup(v) + if(!host) + host = "us"; + + if(!display) + display = "ISO-8859-1"; + replace_pointer(hSession->charset.host, host); replace_pointer(hSession->charset.display,display); diff --git a/src/include/lib3270-internals.h b/src/include/lib3270-internals.h index f04a191..7f08a8b 100644 --- a/src/include/lib3270-internals.h +++ b/src/include/lib3270-internals.h @@ -274,8 +274,6 @@ struct lib3270_text #endif // !LIB3270_TA #define LIB3270_MB_MAX 16 -#define LIB3270_DEFAULT_CGEN 0x02b90000 -#define LIB3270_DEFAULT_CSET 0x00000025 #define LIB3270_FULL_MODEL_NAME_LENGTH 13 #define LIB3270_LU_MAX 32 diff --git a/src/include/lib3270/charset.h b/src/include/lib3270/charset.h index ff19d10..deeebf3 100644 --- a/src/include/lib3270/charset.h +++ b/src/include/lib3270/charset.h @@ -37,6 +37,9 @@ extern "C" { #endif + #define LIB3270_DEFAULT_CGEN 0x02b90000 + #define LIB3270_DEFAULT_CSET 0x00000025 + struct lib3270_charset { char * host; -- libgit2 0.21.2