Room info in banner should respect utf8 when cutting the text; fixed.
authorWilfried Goesgens <dothebart@citadel.org>
Wed, 15 Dec 2010 09:03:03 +0000 (10:03 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 15 Dec 2010 09:03:03 +0000 (10:03 +0100)
webcit/roomtokens.c

index 80561a457f60c9a45e1c88686af4e459acdbdeed..cff35cdf560cb66923f4d2bba5784ef028bd967d 100644 (file)
@@ -468,8 +468,9 @@ void tmplput_ThisRoomInfoText(StrBuf *Target, WCTemplputParams *TP)
        }
        else {
                /* only a certain number of characters */
-               StrBuf *SubBuf = NewStrBuf();
-               StrBufSub(SubBuf, WCC->CurRoom.XInfoText, 0, nchars);
+               StrBuf *SubBuf;
+               SubBuf = NewStrBufDup(WCC->CurRoom.XInfoText);
+               StrBuf_Utf8StrCut(SubBuf, nchars);
                StrBufAppendBufPlain(SubBuf, HKEY("..."), 0);
                StrBufAppendTemplate(Target, TP, SubBuf, 1);
                FreeStrBuf(&SubBuf);