Encodes the given segment to be used as part of a JSON Pointer
JSON Pointer has special meaning for "/" and "~", therefore these must be encoded
Encodes the given segment to be used as part of a JSON Pointer
JSON Pointer has special meaning for "/" and "~", therefore these must be encoded