iconv detection: replace badly working local hack with iconv.m4 from gettext

This commit is contained in:
Jean-Francois Dockes
2017-06-29 13:24:36 +02:00
parent 40af250a8b
commit 25e15f8f85
5 changed files with 911 additions and 71 deletions
+2 -8
View File
@@ -29,12 +29,6 @@ using std::string;
#include "transcode.h"
#include "log.h"
#ifdef RCL_ICONV_INBUF_CONST
#define ICV_P2_TYPE const char**
#else
#define ICV_P2_TYPE char**
#endif
// We gain approximately 25% exec time for word at a time conversions by
// caching the iconv_open thing.
//
@@ -98,8 +92,8 @@ bool transcode(const string &in, string &out, const string &icode,
op = obuf;
osiz = OBSIZ;
if(iconv(ic, (ICV_P2_TYPE)&ip, &isiz, &op, &osiz) == (size_t)-1 &&
errno != E2BIG) {
if(iconv(ic, (ICONV_CONST char **)&ip, &isiz, &op, &osiz) == (size_t)-1
&& errno != E2BIG) {
#if 0
out.erase();
out = string("iconv failed for ") + icode + " -> " + ocode +