From b5aeca94b6f4cbf89072431212cbdef28a8aff18 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 7 Jun 2020 10:38:22 -0700 Subject: [PATCH] Bug 797746 - [reports] German umlauts not escaped Resume using libintl directly. Guile apparently passes gettext msgstrs through scm_from_locale_string instead of scm_from_utf8_string. --- bindings/core-utils.i | 5 +++++ bindings/guile/core-utils.scm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/core-utils.i b/bindings/core-utils.i index f66a184e80..8695d64cdb 100644 --- a/bindings/core-utils.i +++ b/bindings/core-utils.i @@ -29,6 +29,8 @@ #include #include #include +#include + %} #if defined(SWIGGUILE) %{ @@ -154,6 +156,8 @@ gchar *gnc_locale_name (void); } +%rename ("gnc:gettext") gettext; +extern const char* gettext(const char*); %rename ("gnc-utf8?") wrap_gnc_utf8_validate; %inline %{ /* This helper function wraps gnc_utf8_validate() into a predicate. */ @@ -162,6 +166,7 @@ gchar *gnc_locale_name (void); { return gnc_utf8_validate(str, -1, 0); } + %} #elif defined(SWIGPYTHON) gboolean gnc_utf8_validate(const gchar *, gssize, const gchar**); diff --git a/bindings/guile/core-utils.scm b/bindings/guile/core-utils.scm index 26ce6d40db..53d363dad3 100644 --- a/bindings/guile/core-utils.scm +++ b/bindings/guile/core-utils.scm @@ -38,7 +38,7 @@ (define-public gnc:version (gnc-version)) ;; gettext functions -(define-public _ gettext) +(define-public _ gnc:gettext) (define-syntax N_ (syntax-rules () ((_ x) x)))