forked from organicmaps/organicmaps
Handle lower case in FromHex().
This commit is contained in:
parent
04500a4ce8
commit
6e0846ec57
2 changed files with 7 additions and 0 deletions
|
@ -42,3 +42,8 @@ UNIT_TEST(EncodeNumber)
|
|||
TEST_EQUAL(NumToHex(uint64_t(0x0123456789ABCDEFULL)),
|
||||
"0123456789ABCDEF", ());
|
||||
}
|
||||
|
||||
UNIT_TEST(DecodeLowerCaseHex)
|
||||
{
|
||||
TEST_EQUAL(FromHex("fe"), "\xfe", ());
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ namespace impl {
|
|||
return (digit - '0');
|
||||
else if (digit >= 'A' && digit <= 'F')
|
||||
return (digit - 'A' + 10);
|
||||
else if (digit >= 'a' && digit <= 'f')
|
||||
return (digit - 'a' + 10);
|
||||
ASSERT(false, (digit));
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue