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:
@@ -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
|
||||
|
||||
@@ -363,6 +366,17 @@ int main(int argc, char *argv[])
|
||||
Device_Set_Object_Instance_Number(BACNET_MAX_INSTANCE);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user