From: John Darrington Date: Sat, 28 Mar 2009 11:50:51 +0000 (+0900) Subject: Convert encoding even if encodings are identical. X-Git-Tag: v0.7.3~195 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa3e1a5079053b45611d421d12e3f276dd2a461a;p=pspp-builds.git Convert encoding even if encodings are identical. recode_string must continue, even if the source and target encodings are identical, because invalid bytes in the source string need to become '?' to avoid later problems. --- diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index b323bf85..a07949f3 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -88,9 +88,6 @@ recode_string (const char *to, const char *from, if (from == NULL) from = default_encoding; - if ( 0 == strcmp (to, from)) - return xstrndup (text, length); - for ( outbufferlength = 1 ; outbufferlength != 0; outbufferlength <<= 1 ) if ( outbufferlength > length) break;