gchq / CyberChef

The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis

Home Page:https://gchq.github.io/CyberChef

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug report: URL Decode function not properly decoding URLs

Matin-B opened this issue · comments

Describe the bug:
The "URL Decode" operation in CyberChef is not properly decoding certain URL-encoded strings.

To Reproduce:

  1. Go to CyberChef (https://gchq.github.io/CyberChef/)
  2. Enter the following URL-encoded string in the input box: https://fa.wikipedia.org/wiki/%D8%B7%D8%B1%D8%AD%E2%80%8C%D9%88%D8%A7%D8%B1%D9%87_%D8%AF%D8%B1%D9%85%D8%A7%D9%86%DB%8C
  3. Add the "URL Decode" operation to the recipe
  4. Run the recipe
  5. The output will be incorrect

Expected behavior:
The "URL Decode" operation should properly decode the input URL-encoded string to the correct URL.
The output should be:
https://fa.wikipedia.org/wiki/طرح‌واره_درمانی

However, the output I am getting is:
https://fa.wikipedia.org/wiki/طرح��ار�_در�ا��

Screenshots
CyberChef

Additional context
The issue is not specific to a particular input string and occurs consistently in the current version of CyberChef. It's important to note that copying the decoded output using the "Copy" button works correctly.

You must change charset/encoding.

image

You must change charset/encoding.

image

Wouldn't it be better if the default output character encoding was set to UTF-8, especially in this case?