summaryrefslogtreecommitdiff
path: root/lib/util/charset
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/charset')
-rw-r--r--lib/util/charset/charset.h1
-rw-r--r--lib/util/charset/util_unistr.c7
2 files changed, 6 insertions, 2 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;
}
/**