diff --git a/src/protocols/ssh/client.c b/src/protocols/ssh/client.c index ea1d1493..f370b5d1 100644 --- a/src/protocols/ssh/client.c +++ b/src/protocols/ssh/client.c @@ -28,6 +28,8 @@ #include "ssh_client.h" #include "terminal.h" +#include +#include #include #include #include @@ -130,6 +132,11 @@ int guac_client_init(guac_client* client, int argc, char** argv) { return -1; } + /* Set locale and warn if not UTF-8 */ + setlocale(LC_CTYPE, ""); + if (strcmp(nl_langinfo(CODESET), "UTF-8") != 0) + guac_client_log_info(client, "Current locale does not use UTF-8. Some characters may not render correctly."); + /* Read parameters */ strcpy(client_data->hostname, argv[IDX_HOSTNAME]); strcpy(client_data->username, argv[IDX_USERNAME]); diff --git a/src/protocols/telnet/client.c b/src/protocols/telnet/client.c index fce5cb82..b76bf839 100644 --- a/src/protocols/telnet/client.c +++ b/src/protocols/telnet/client.c @@ -27,6 +27,8 @@ #include "telnet_client.h" #include "terminal.h" +#include +#include #include #include #include @@ -92,6 +94,11 @@ int guac_client_init(guac_client* client, int argc, char** argv) { return -1; } + /* Set locale and warn if not UTF-8 */ + setlocale(LC_CTYPE, ""); + if (strcmp(nl_langinfo(CODESET), "UTF-8") != 0) + guac_client_log_info(client, "Current locale does not use UTF-8. Some characters may not render correctly."); + /* Read parameters */ strcpy(client_data->hostname, argv[IDX_HOSTNAME]);