From a25f87a739943312b0a0ffa3943b584fd8265102 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 4 Oct 2011 22:32:04 +0000 Subject: make nsurl__create_from_section correctly escape characters as per RFC3986 svn path=/trunk/netsurf/; revision=12948 --- utils/utils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'utils/utils.h') diff --git a/utils/utils.h b/utils/utils.h index 079708843..ffd4f2977 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -151,6 +151,16 @@ inline static char digit2lowcase_hex(unsigned char digit) { return "0123456789abcdef"[digit]; } +/** + * Return a hex digit for the given numerical value. + * + * \return character in range 0-9A-F + */ +inline static char digit2uppercase_hex(unsigned char digit) { + assert(digit < 16); + return "0123456789ABCDEF"[digit]; +} + /* Platform specific functions */ void die(const char * const error); -- cgit v1.2.3