Преглед изворни кода

!1 support utf8
Merge pull request !1 from 3swordman/master

rain пре 4 година
родитељ
комит
f3ec36500b
1 измењених фајлова са 6 додато и 0 уклоњено
  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();