Skip to content

Commit

Permalink
- let the CSV parser for the string table handle hex escapes.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed May 17, 2021
1 parent 668f8f2 commit 0b5b919
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/common/engine/stringtable.cpp
Expand Up @@ -513,8 +513,30 @@ size_t FStringTable::ProcessEscapes (char *iptr)
c = '\r';
else if (c == 't')
c = '\t';
else if (c == 'x')
{
c = 0;
for (int i = 0; i < 2; i++)
{
char cc = *iptr++;
if (cc >= '0' && cc <= '9')
c = (c << 4) + cc - '0';
else if (cc >= 'a' && cc <= 'f')
c = (c << 4) + 10 + cc - 'a';
else if (cc >= 'A' && cc <= 'F')
c = (c << 4) + 10 + cc - 'A';
else
{
iptr--;
break;
}
}
if (c == 0) continue;
}
else if (c == '\n')
continue;


}
*optr++ = c;
}
Expand Down

0 comments on commit 0b5b919

Please sign in to comment.