decodeURI không giải mã được dấu %

/**

 * decodeURI() can't decode the `%` character, as it is used in any encoded character
 * @author [Why does decodeURIComponent('%') lock up my browser?](https://stackoverflow.com/a/54310080/3416774)
 */
export function decodeURIComponentSafe(path: string): string {
  return decodeURIComponent(path.replace(/%(?![0-9a-fA-F]+)/g, "%25"));
}

GitHub - jridgewell/safe-decode-uri-component: Safely decode URI components, leaving invalid sequences as they are

Nguồn:: Why does decodeURIComponent(‘%’) lock up my browser?

encodeURI nên được đặt tên là fixBrokenURI, còn decodeURI nên được đặt là potentiallyBreakMyPreviouslyWorkingURI
Mặc dù trong đường dẫn được phép có ký tự Unicode, các spec khác nhau sẽ có những cách chấp nhận khác nhau