From: Wilfried Goesgens Date: Wed, 15 Dec 2010 09:03:03 +0000 (+0100) Subject: Room info in banner should respect utf8 when cutting the text; fixed. X-Git-Tag: v8.01~505 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=2b1667d2828e4337fbee72d051d14e1c69453d9c Room info in banner should respect utf8 when cutting the text; fixed. --- diff --git a/webcit/roomtokens.c b/webcit/roomtokens.c index 80561a457..cff35cdf5 100644 --- a/webcit/roomtokens.c +++ b/webcit/roomtokens.c @@ -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);