RT 36540 support parsing upper case hex numbers

Fixed RT 36540 ("0X0D" and the like not parsing as single hex number) as supplied by Kevin Ryde in the ticket, with tests.