Bläddra i källkod

vcc: use utf8 at default

3swordman 4 år sedan
förälder
incheckning
c7137ad081
1 ändrade filer med 6 tillägg och 0 borttagningar
  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();