Created
August 27, 2016 15:55
-
-
Save hugoArregui/7b5626c7dc00f45cdb4ea8721db4f777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey guys, | |
I finally discover the problem, it looks like gtk_init changes the C | |
locale to use the user one, and since my locale is es_AR.UTF-8, the | |
strtow function couldn't parse a numeric constant, so this works: | |
;; test.scm | |
(import chicken scheme foreign) | |
#> | |
#include <gtk/gtk.h> | |
#include <locale.h> | |
int main(int argc, char** argv) { | |
gtk_init(&argc, &argv); | |
setlocale(LC_NUMERIC, "C"); //<-- this | |
CHICKEN_run(C_toplevel); | |
return 0; | |
} | |
<# | |
(print "hey") | |
(return-to-host) | |
;; | |
It looks like CHICKEN requires some specific locale, I wonder if it's | |
worthy to add an assertion check somewhere? (perhaps on | |
convert_string_to_number?) | |
------------------------------------------ | |
I thought that may be useful to have a test case of this problem | |
without gtk: | |
;; | |
(import chicken scheme foreign) | |
#> | |
#include <locale.h> | |
int main(int argc, char** argv) { | |
setlocale(LC_NUMERIC, "es_AR.UTF-8"); | |
CHICKEN_run(C_toplevel); | |
return 0; | |
} | |
<# | |
(return-to-host) | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment