summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-11 18:17:49 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-11 18:17:49 -0800
commitafbf93478e0a04a12d11dc8933eaa2a779353cb3 (patch)
treed1cd3b08bfaed8ff687d8092a33582422a0b9622 /txr.c
parentd59d8950ec58702821ec618b92dfb2490ae0bf31 (diff)
downloadtxr-afbf93478e0a04a12d11dc8933eaa2a779353cb3.tar.gz
txr-afbf93478e0a04a12d11dc8933eaa2a779353cb3.tar.bz2
txr-afbf93478e0a04a12d11dc8933eaa2a779353cb3.zip
* txr.c (main): call setlocale to set the LC_CTYPE to en_US.UTF-8,
so that the C library streams do the encoding. Once the program is weaned from C library wide character stream I/O, this can go away.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/txr.c b/txr.c
index 6192014b..92593202 100644
--- a/txr.c
+++ b/txr.c
@@ -32,6 +32,7 @@
#include <dirent.h>
#include <setjmp.h>
#include <wchar.h>
+#include <locale.h>
#include "lib.h"
#include "stream.h"
#include "gc.h"
@@ -142,6 +143,7 @@ int main(int argc, char **argv)
obj_t *stack_bottom = nil;
progname = argv[0] ? utf8_dup_from(argv[0]) : progname;
init(progname, oom_realloc_handler, &stack_bottom);
+ setlocale(LC_CTYPE, "en_US.UTF-8");
return txr_main(argc, argv);
}