DBG+GUI: resolved issue #609 (fixed assert for UTF-8 characters) + updated translation
This commit is contained in:
parent
60034795e5
commit
7830ec98e5
|
|
@ -1,6 +1,9 @@
|
|||
#include <sstream>
|
||||
#include "stringutils.h"
|
||||
#include "memory.h"
|
||||
#include "dynamicmem.h"
|
||||
#include <windows.h>
|
||||
#include <cstdint>
|
||||
|
||||
StringList StringUtils::Split(const String & s, char delim, std::vector<String> & elems)
|
||||
{
|
||||
|
|
@ -27,7 +30,7 @@ String StringUtils::Escape(const String & s)
|
|||
String escaped = "";
|
||||
for(size_t i = 0; i < s.length(); i++)
|
||||
{
|
||||
char ch = s[i];
|
||||
auto ch = uint8_t(s[i]);
|
||||
switch(ch)
|
||||
{
|
||||
case '\t':
|
||||
|
|
@ -55,7 +58,7 @@ String StringUtils::Escape(const String & s)
|
|||
if(!isprint(ch)) //unknown unprintable character
|
||||
{
|
||||
char buf[16] = "";
|
||||
sprintf_s(buf, "\\x%.2X", (unsigned char)ch);
|
||||
sprintf_s(buf, "\\x%02X", ch);
|
||||
escaped += buf;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue