Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Mar 2007 13:56:51 +0400
From:      "Andrew Pantyukhin" <infofarmer@FreeBSD.org>
Cc:        freebsd-gnome@freebsd.org
Subject:   Re: Need a suggest the best way to fix iconv..
Message-ID:  <cb5206420703290256o5db9e3b1l69bc94fb768a0cbd@mail.gmail.com>
In-Reply-To: <cb5206420703290158r5c5c0465l7f2587967db87f58@mail.gmail.com>
References:  <op.tnaf1tni9aq2h7@mezz.mezzweb.com> <45C7F45D.4020407@FreeBSD.org> <cb5206420703290158r5c5c0465l7f2587967db87f58@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3/29/07, Andrew Pantyukhin <infofarmer@freebsd.org> wrote:
> This iconv issue appears every now and again. I'm sorry
> to bother you guys, but any suggestions how to fix this
> one are welcome:
>
> ==================================================
>         size_t inSize;
>         char *in;
>         if (myBuffer.empty()) {
>                 inSize = srcEnd - srcStart;
>                 in = (char*)srcStart;
>         } else {
>                 myBuffer.append(srcStart, srcEnd - srcStart);
>                 inSize = myBuffer.length();
>                 in = (char*)myBuffer.data();
>         }
>
>         size_t outSize = 3 * inSize;
>         const size_t startOutSize = outSize;
>         size_t oldLength = dst.length();
>         dst.append(outSize, '\0');
>         char *out = (char*)dst.data() + oldLength;
>
> iconvlabel:
>         iconv(myIConverter, &in, &inSize, &out, &outSize);
> ==================================================
>
> Should I add another const and initialize with "in"?

hmm, just a cast to (const char**) works for me. I'm
not sure it's the best solution, though.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cb5206420703290256o5db9e3b1l69bc94fb768a0cbd>