From e4560ecec44e74cff7b31695114a3b52304beac3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 5 May 2021 00:35:45 +0100 Subject: Only vendor the bits of utfcpp that we actually use. --- src/modules/m_websocket.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp index 05a9ce2e8..da8bd382b 100644 --- a/src/modules/m_websocket.cpp +++ b/src/modules/m_websocket.cpp @@ -25,7 +25,8 @@ #include "iohook.h" #include "modules/hash.h" -#include +#define UTF_CPP_CPLUSPLUS 199711L +#include static const char MagicGUID[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; static const char whitespace[] = " \t\r\n"; @@ -439,7 +440,7 @@ class WebSocketHook : public IOHookMiddle { // If we send messages as text then we need to ensure they are valid UTF-8. std::string encoded; - utf8::replace_invalid(message.begin(), message.end(), std::back_inserter(encoded)); + utf8::unchecked::replace_invalid(message.begin(), message.end(), std::back_inserter(encoded)); mysendq.push_back(PrepareSendQElem(encoded.length(), OP_TEXT)); mysendq.push_back(encoded); -- cgit v1.2.3