Decodes a URI component string according to RFC 3986 specifications.
This function first replaces specific percent-encoded characters (%21, %2A, %28, %29, %27)
with their corresponding literal characters (!, *, (, ), ') before applying decodeURIComponent.
This ensures compatibility with RFC 3986, which allows these characters to remain unencoded in URI components.
Parameters
str: string
The percent-encoded URI component string to decode.
Returns string
The decoded string, with RFC 3986 reserved characters properly handled.
Decodes a URI component string according to RFC 3986 specifications.
This function first replaces specific percent-encoded characters (
%21,%2A,%28,%29,%27) with their corresponding literal characters (!,*,(,),') before applyingdecodeURIComponent. This ensures compatibility with RFC 3986, which allows these characters to remain unencoded in URI components.