Explorar o código

vcc: use utf8 at default

3swordman %!s(int64=4) %!d(string=hai) anos
pai
achega
c7137ad081
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      main.c

+ 6 - 0
main.c

@@ -25,6 +25,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
+#include <locale.h>
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -124,6 +125,11 @@ int main(int argc, const char **argv) {
 	struct vcc_request 	*req;
 	char 			*buf, *msg;
 	int 			n, size;
+#ifdef _WIN32
+	setlocale(LC_ALL, ".UTF-8");
+#else
+	setlocale(LC_ALL, "C.UTF-8");
+#endif
 
 	if (unlikely(argc != 1 && argc != 2)) 
 		return usage();