diff options
author | Sadie Powell <sadie@witchery.services> | 2021-05-05 00:35:45 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2021-05-05 00:38:05 +0100 |
commit | e4560ecec44e74cff7b31695114a3b52304beac3 (patch) | |
tree | 9e7cb876f2703377cdc8a66727c03808257f19da /src/modules/m_websocket.cpp | |
parent | 96e059d2ec54d5af086670cfbd8fe8dac2406634 (diff) |
Only vendor the bits of utfcpp that we actually use.
Diffstat (limited to 'src/modules/m_websocket.cpp')
-rw-r--r-- | src/modules/m_websocket.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 <utf8.h> +#define UTF_CPP_CPLUSPLUS 199711L +#include <unchecked.h> 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); |