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.
This commit is contained in:
John Ralls 2020-06-07 10:38:22 -07:00
parent 55aadc0b1a
commit b5aeca94b6
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,8 @@
#include <gnc-locale-utils.h> #include <gnc-locale-utils.h>
#include <glib.h> #include <glib.h>
#include <gnc-version.h> #include <gnc-version.h>
#include <libintl.h>
%} %}
#if defined(SWIGGUILE) #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; %rename ("gnc-utf8?") wrap_gnc_utf8_validate;
%inline %{ %inline %{
/* This helper function wraps gnc_utf8_validate() into a predicate. */ /* 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); return gnc_utf8_validate(str, -1, 0);
} }
%} %}
#elif defined(SWIGPYTHON) #elif defined(SWIGPYTHON)
gboolean gnc_utf8_validate(const gchar *, gssize, const gchar**); gboolean gnc_utf8_validate(const gchar *, gssize, const gchar**);

View File

@ -38,7 +38,7 @@
(define-public gnc:version (gnc-version)) (define-public gnc:version (gnc-version))
;; gettext functions ;; gettext functions
(define-public _ gettext) (define-public _ gnc:gettext)
(define-syntax N_ (define-syntax N_
(syntax-rules () (syntax-rules ()
((_ x) x))) ((_ x) x)))