From 7197005e31b55e280416633a1e037d8b7b09db5e Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 29 Jan 2008 14:10:40 +0000 Subject: fixing unicode. --- lib/String.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/String.cc b/lib/String.cc index 3d13efd..b4d0f6a 100644 --- a/lib/String.cc +++ b/lib/String.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: String.cc,v 1.50 2008-01-25 13:43:50 pixel Exp $ */ +/* $Id: String.cc,v 1.51 2008-01-29 14:10:40 pixel Exp $ */ #include #include @@ -598,11 +598,13 @@ String & String::iconv(const String & from, const String & _to) { siz = outbuf - t; - // let's pad up to 2 bytes in order to be safe with wchar_t's - str = (char *) malloc(siz + 2); + // let's pad up to 4 bytes in order to be safe with wchar_t's + str = (char *) malloc(siz + 4); memcpy(str, t, siz); - str[siz] = 0; + str[siz + 0] = 0; str[siz + 1] = 0; + str[siz + 2] = 0; + str[siz + 3] = 0; UNLOCK; iconv_close(cd); -- cgit v1.2.3