From b9ad162723172ad1174213a2f687510315f82af2 Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Tue, 4 Dec 2018 11:18:22 -0600 Subject: [PATCH] GTK+: Set locale to C when loading shader files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't know what format they're in, and for some reason espaƱol breaks them. --- gtk/src/gtk_display_driver_opengl.cpp | 4 ++++ gtk/src/gtk_s9x.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/gtk/src/gtk_display_driver_opengl.cpp b/gtk/src/gtk_display_driver_opengl.cpp index d069735e..8c1e3f16 100644 --- a/gtk/src/gtk_display_driver_opengl.cpp +++ b/gtk/src/gtk_display_driver_opengl.cpp @@ -362,6 +362,8 @@ int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file) { int length = strlen (shader_file); + setlocale (LC_ALL, "C"); + if ((length > 6 && !strcasecmp(shader_file + length - 6, ".glslp")) || (length > 5 && !strcasecmp(shader_file + length - 5, ".glsl"))) { @@ -374,12 +376,14 @@ int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file) if (glsl_shader->param.size () > 0) window->enable_widget ("shader_parameters_item", TRUE); + setlocale (LC_ALL, ""); return 1; } delete glsl_shader; } + setlocale (LC_ALL, ""); return 0; } diff --git a/gtk/src/gtk_s9x.cpp b/gtk/src/gtk_s9x.cpp index a287566e..b347803b 100644 --- a/gtk/src/gtk_s9x.cpp +++ b/gtk/src/gtk_s9x.cpp @@ -42,6 +42,7 @@ int main (int argc, char *argv[]) g_set_prgname ("snes9x"); g_set_application_name ("Snes9x"); + setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, SNES9XLOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE);