-#include <algorithm>
#include <list>
#include <stdexcept>
#include <cctype>
+#include <msp/core/algorithm.h>
#include "utils.h"
using namespace std;
string tolower(const string &str)
{
string result(str);
- transform(result.begin(), result.end(), result.begin(), [](char c){ return std::tolower(c); });
+ transform(result, [](char c){ return std::tolower(c); });
return result;
}
string toupper(const string &str)
{
string result(str);
- transform(result.begin(), result.end(), result.begin(), [](char c){ return std::toupper(c); });
+ transform(result, [](char c){ return std::toupper(c); });
return result;
}
result += "\\\'";
else if(c=='\\')
result += "\\\\";
- else if(static_cast<unsigned char>(c)<' ' || (escape_8bit && (c&0x80)))
+ else if(static_cast<unsigned char>(c)<' ' || c==0x7F || (escape_8bit && (c&0x80)))
{
char buf[4] = { '\\', 0 };
for(unsigned j=0; j<3; ++j)