From 05eb75442ad3f68fe81b771e75c1842d96069ed7 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 7 Dec 2017 22:21:54 +0100 Subject: Split on UTF-8 for MessageSplit (irc). Closes #308 --- bridge/irc/irc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 0a24ec75..b493997a 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -197,8 +197,9 @@ func (b *Birc) Send(msg config.Message) (string, error) { msg.Text = helper.SplitStringLength(msg.Text, b.Config.MessageLength) } for _, text := range strings.Split(msg.Text, "\n") { + input := []rune(text) if len(text) > b.Config.MessageLength { - text = text[:b.Config.MessageLength] + " " + text = string(input[:b.Config.MessageLength]) + " " } if len(b.Local) < b.Config.MessageQueue { if len(b.Local) == b.Config.MessageQueue-1 { -- cgit v1.2.3