summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--irc/channel.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/irc/channel.go b/irc/channel.go
index c4a9e6f..b318784 100644
--- a/irc/channel.go
+++ b/irc/channel.go
@@ -4,6 +4,8 @@ import (
"bufio"
"fmt"
"net"
+ "strings"
+ "unicode"
)
const chanCapacity = 64
@@ -16,6 +18,7 @@ func ChanInOut(conn net.Conn) (in <-chan Message, out chan<- Message) {
r := bufio.NewScanner(conn)
for r.Scan() {
line := r.Text()
+ line = strings.ToValidUTF8(line, string([]rune{unicode.ReplacementChar}))
msg, err := ParseMessage(line)
if err != nil {
continue