From 1151c26c363e736a98c5fcb723c753658fe35b9b Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 28 Nov 2013 02:14:42 +0100 Subject: Channel names are case insensitive But some servers (epiknet for example) send channel names with an uppercase --- src/utils/tolower.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/utils/tolower.hpp (limited to 'src/utils/tolower.hpp') diff --git a/src/utils/tolower.hpp b/src/utils/tolower.hpp new file mode 100644 index 0000000..22d2b8f --- /dev/null +++ b/src/utils/tolower.hpp @@ -0,0 +1,18 @@ +#ifndef TOLOWER_INCLUDED +# define TOLOWER_INCLUDED + +#include + +namespace utils +{ + std::string tolower(const std::string& original) + { + std::string res; + res.reserve(original.size()); + for (const char c: original) + res += static_cast(std::tolower(c)); + return res; + } +} + +#endif // SPLIT_INCLUDED -- cgit v1.2.3