summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/charset/charset.h1
-rw-r--r--lib/util/charset/util_unistr.c7
-rw-r--r--source4/param/loadparm.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h
index 56fa36faf3..51e0193173 100644
--- a/lib/util/charset/charset.h
+++ b/lib/util/charset/charset.h
@@ -122,6 +122,7 @@ ssize_t convert_string(charset_t from, charset_t to,
void const *src, size_t srclen,
void *dest, size_t destlen);
+extern struct smb_iconv_convenience *global_iconv_convenience;
/* codepoints */
codepoint_t next_codepoint(struct smb_iconv_convenience *ic,
diff --git a/lib/util/charset/util_unistr.c b/lib/util/charset/util_unistr.c
index 91d0be109a..a40b4298a4 100644
--- a/lib/util/charset/util_unistr.c
+++ b/lib/util/charset/util_unistr.c
@@ -20,11 +20,14 @@
#include "includes.h"
#include "system/locale.h"
-#include "param/param.h"
+
+struct smb_iconv_convenience *global_iconv_convenience = NULL;
static inline struct smb_iconv_convenience *get_iconv_convenience(void)
{
- return lp_iconv_convenience(global_loadparm);
+ if (global_iconv_convenience == NULL)
+ global_iconv_convenience = smb_iconv_convenience_init(talloc_autofree_context(), "ASCII", "UTF-8", true);
+ return global_iconv_convenience;
}
/**
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index fb8afe456c..a019c951de 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -2608,7 +2608,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(struct loadparm_context *lp_c
_PUBLIC_ void reload_charcnv(struct loadparm_context *lp_ctx)
{
talloc_free(lp_ctx->iconv_convenience);
- lp_ctx->iconv_convenience = smb_iconv_convenience_init_lp(lp_ctx, lp_ctx);
+ global_iconv_convenience = lp_ctx->iconv_convenience = smb_iconv_convenience_init_lp(lp_ctx, lp_ctx);
}
void lp_smbcli_options(struct loadparm_context *lp_ctx,