Added UTF8 multibyte to wide char printing in some apps (#106)

* Added UTF8 multibyte to wide char printing in some apps

* Fix test compile

* Reduce diff churn

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2020-07-27 22:44:43 -05:00
committed by GitHub
parent 2af16ab14d
commit f41b5377cc
5 changed files with 111 additions and 12 deletions
+14
View File
@@ -29,6 +29,9 @@
#include <stdlib.h>
#include <errno.h>
#include <time.h> /* for time */
#ifdef __STDC_ISO_10646__
#include <locale.h>
#endif
#define PRINT_ENABLED 1
@@ -423,6 +426,17 @@ int main(int argc, char *argv[])
address_init();
Init_Service_Handlers();
dlenv_init();
#ifdef __STDC_ISO_10646__
/* Internationalized programs must call setlocale()
* to initiate a specific language operation.
* This can be done by calling setlocale() as follows.
* If your native locale doesn't use UTF-8 encoding
* you need to replace the empty string with a
* locale like "en_US.utf8" which is the same as the string
* used in the enviromental variable "LANG=en_US.UTF-8".
*/
setlocale(LC_ALL, "");
#endif
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);