diff --git a/charset.c b/charset.c index f6aa31b..5ec92c6 100644 --- a/charset.c +++ b/charset.c @@ -300,12 +300,18 @@ LIB3270_EXPORT const char * lib3270_get_default_charset(void) return "ISO-8859-1"; } -LIB3270_EXPORT const char * lib3270_get_charset(H3270 *hSession) +LIB3270_EXPORT const char * lib3270_get_display_charset(H3270 *hSession) { CHECK_SESSION_HANDLE(hSession); return hSession->charset.display ? hSession->charset.display : "ISO-8859-1"; } +LIB3270_EXPORT const char * lib3270_get_host_charset(H3270 *hSession) +{ + CHECK_SESSION_HANDLE(hSession); + return hSession->charset.host; +} + LIB3270_ACTION( charsettable ) { static const char * hChars = "0123456789ABCDEF"; diff --git a/html.c b/html.c index 15e0a62..aee2a6d 100644 --- a/html.c +++ b/html.c @@ -244,7 +244,7 @@ if(option & LIB3270_HTML_OPTION_HEADERS) { - char *txt = xs_buffer(element_text[HTML_ELEMENT_HEADER],lib3270_get_charset(session),html_color[0]); + char *txt = xs_buffer(element_text[HTML_ELEMENT_HEADER],lib3270_get_display_charset(session),html_color[0]); append_string(&info,txt); lib3270_free(txt); } diff --git a/macros.c b/macros.c index 5631162..30112dc 100644 --- a/macros.c +++ b/macros.c @@ -88,7 +88,7 @@ LIB3270_MACRO( encoding ) { - return strdup(lib3270_get_charset(hSession)); + return strdup(lib3270_get_display_charset(hSession)); } LIB3270_MACRO( get ) -- libgit2 0.21.2