From 114efe593614b5d38f8b9fdd6a70704bae946e94 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 29 Apr 2019 14:58:56 -0700 Subject: [PATCH] Transcode non-constant strings before passing them to scm_eval_string. Instead of using scm_c_eval_string, which transcodes with scm_from_locale_string. That doesn't work on Windows. --- gnucash/report/report-gnome/gnc-plugin-page-report.c | 3 +-- libgnucash/app-utils/gnc-gsettings.c | 4 ++-- libgnucash/app-utils/test/test-scm-query-string.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gnucash/report/report-gnome/gnc-plugin-page-report.c b/gnucash/report/report-gnome/gnc-plugin-page-report.c index 2ff828e1ee..be29976295 100644 --- a/gnucash/report/report-gnome/gnc-plugin-page-report.c +++ b/gnucash/report/report-gnome/gnc-plugin-page-report.c @@ -932,8 +932,7 @@ gnc_plugin_page_report_recreate_page (GtkWidget *window, LEAVE("bad value"); return NULL; } - - scm_id = scm_c_eval_string(option_string); + scm_id = scm_eval_string(scm_from_utf8_string(option_string)); g_free(option_string); if (!scm_integer_p(scm_id)) diff --git a/libgnucash/app-utils/gnc-gsettings.c b/libgnucash/app-utils/gnc-gsettings.c index d2f0fc69d6..9c144aa7cb 100644 --- a/libgnucash/app-utils/gnc-gsettings.c +++ b/libgnucash/app-utils/gnc-gsettings.c @@ -809,7 +809,7 @@ static void gnc_gsettings_migrate_from_gconf (void) command = g_strconcat ("(use-modules (migrate-prefs))(migration-prepare \"", base_dir, "\")", NULL); DEBUG ("command = %s", command); - migration_ok = scm_is_true (scm_c_eval_string (command)); + migration_ok = scm_is_true (scm_eval_string (scm_from_utf8_string (command))); g_free (command); if (!migration_ok) { @@ -867,7 +867,7 @@ static void gnc_gsettings_migrate_from_gconf (void) command = g_strconcat ("(use-modules (migrate-prefs))(migration-cleanup \"", base_dir, "\")", NULL); DEBUG ("command = %s", command); - migration_ok = scm_is_true (scm_c_eval_string (command)); + migration_ok = scm_is_true (scm_eval_string (scm_from_utf8_string (command))); g_free (command); if (!migration_ok) /* Cleanup step failed, not critical */ PWARN ("Cleanup step failed. You may need to delete %s/.gnc-migration-tmp manually.", base_dir); diff --git a/libgnucash/app-utils/test/test-scm-query-string.cpp b/libgnucash/app-utils/test/test-scm-query-string.cpp index b9f2a82e3a..e7d381641f 100644 --- a/libgnucash/app-utils/test/test-scm-query-string.cpp +++ b/libgnucash/app-utils/test/test-scm-query-string.cpp @@ -55,7 +55,7 @@ test_query (Query *q, SCM val2str) str2 = gnc_scm_to_utf8_string (str_q); if (str2) { - res_q = scm_c_eval_string (str2); + res_q = scm_eval_string (str_q); } else {