From 864ed2c8f98b8260b5a07f2d0f002930c9e38ac3 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 31 Oct 2006 18:54:30 +0000 Subject: [PATCH] * src/support/docstream.C (iconv_codecvt_facet::do_max_length): Update to current UTF8 specification and return 4 for UTF8. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15642 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/docstream.C | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/support/docstream.C b/src/support/docstream.C index 03ee204633..4347d6ba5b 100644 --- a/src/support/docstream.C +++ b/src/support/docstream.C @@ -148,10 +148,13 @@ protected: } virtual int do_max_length() const throw() { - // UTF8 uses at most 6 bytes to represent one UCS4 code point. + // UTF8 uses at most 4 bytes to represent one UCS4 code point + // (see RFC 3629). RFC 2279 specifies 6 bytes, but that + // information is outdated, and RFC 2279 has been superseded by + // RFC 3629. // All other encodings encode one UCS4 code point in one byte // (and can therefore only encode a subset of UCS4) - return utf8_ ? 6 : 1; + return utf8_ ? 4 : 1; } private: /// Do the actual conversion. The interface is equivalent to that of -- 2.39.2