From c26050ac83a516fb0a7b0a94f3a1cfc3212b0260 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Thu, 27 Dec 2007 07:30:06 +0000 Subject: [PATCH] * src/support/unicode.cpp (convert): - flush out data at the end of the conversion process (bug 4439). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22319 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/unicode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/support/unicode.cpp b/src/support/unicode.cpp index 3270e7bb18..8e003437e3 100644 --- a/src/support/unicode.cpp +++ b/src/support/unicode.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * * Full author contact details are available in file CREDITS. * @@ -134,6 +134,11 @@ int IconvProcessor::convert(char const * buf, size_t buflen, int res = iconv(pimpl_->cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + // flush out remaining data. This is needed because iconv sometimes + // holds back chars in the stream, waiting for a combination character + // (see e.g. http://sources.redhat.com/bugzilla/show_bug.cgi?id=1124) + iconv(pimpl_->cd, NULL, NULL, &outbuf, &outbytesleft); + //lyxerr << dec; //lyxerr << "Inbytesleft: " << inbytesleft << endl; //lyxerr << "Outbytesleft: " << outbytesleft << endl; -- 2.39.2