Functions to URL encode/decode a region.