summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2023-08-06 13:32:35 +0800
committerMole Shang <[email protected]>2023-08-06 13:36:06 +0800
commit1ae17d1a63506421621e0e9e4a115bb22f9657db (patch)
tree5a959e7a1bccd9949922212820013cade2c48042 /src/main.c
parent5434e3e707c33b6fbd0f3d58b296c3232bba4847 (diff)
downloadhinata-1ae17d1a63506421621e0e9e4a115bb22f9657db.tar.gz
hinata-1ae17d1a63506421621e0e9e4a115bb22f9657db.tar.bz2
hinata-1ae17d1a63506421621e0e9e4a115bb22f9657db.zip
hinata: set locale to UTF-8 by default
Enable UTF-8 mode on Windows to avoid filename encoding issues. Ref: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-170#utf-8-support
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 4306b87..e9d22f1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,7 @@
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <curl/curl.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
@@ -36,6 +37,9 @@ static void error_callback(int e, const char *d) {
int main(void) {
struct ui_struct ui;
+ /* Set locale*/
+ setlocale(LC_ALL, ".UTF-8");
+
/* Curl */
curl_init();