Print non-ascii characters as numbers in CharacterRange::to_string
This commit is contained in:
parent
13ba35e26f
commit
e0185f84fc
1 changed files with 5 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ namespace rules {
|
|||
|
||||
using std::ostream;
|
||||
using std::string;
|
||||
using std::to_string;
|
||||
|
||||
CharacterRange::CharacterRange(uint32_t value) : min(value), max(value) {}
|
||||
CharacterRange::CharacterRange(uint32_t min, uint32_t max)
|
||||
|
|
@ -26,7 +27,10 @@ bool CharacterRange::operator<(const CharacterRange &other) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
string escape_character(unsigned char input) {
|
||||
string escape_character(uint32_t input) {
|
||||
if (input >= 255)
|
||||
return to_string(input);
|
||||
|
||||
switch (input) {
|
||||
case '\0':
|
||||
return "\\0";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue