Pārlūkot izejas kodu

vcc: use utf8 at default

3swordman 4 gadi atpakaļ
vecāks
revīzija
c7137ad081
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  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();