Decoding a text that contains '50% off' gives an error about the % sign. How should a percentage be written in a link?
In encoded text every % must start a code such as %20, so the lone % in 50% makes decoding fail, and the tool points to its position instead of failing silently. The fix is to encode the original text rather than decode it: the % is then written as %25 and survives the trip.
Why decoding refuses a lone %
In links the % sign has a reserved meaning: it starts a three-character code, the sign followed by two hexadecimal digits that stand for one byte. A space, for example, is %20. When the decoder meets '50%' followed by a space, it looks for two hex digits after the sign, finds none, and has no way to interpret it.
We decoded the text 'خصم 50% اليوم' (50% off today) exactly as it was. The tool refused with 'Decoding is not possible because the text contains invalid encoding', then 'Position 7: a % that is not followed by two hexadecimal digits'. Position 7 is where the sign sits when you count characters from the start, including the space.
The fix: encode the text instead of decoding it
That text was never encoded, so there is nothing to decode. What you need is to encode it before it goes into a link. With 'Encode' and 'Component' selected, the tool gave:
%D8%AE%D8%B5%D9%85%2050%25%20%D8%A7%D9%84%D9%8A%D9%88%D9%85
Look at the %2050%25 in the middle: %20 is the space, then 50, then %25, which is the encoded % sign. Decoding that output again returned the original text in full with no error.
Steps
- Open the URL encoder/decoder, choose 'Encode', then the 'Component' mode.
- Paste the offer text exactly as the customer should read it, with an ordinary % sign.
- Copy the output and place it as a value in the link, such as the text value of a ready-made message link.
- To be sure, paste the output into 'Decode' and check that it returns your original text.
Other cases that trigger the same message
- A % followed by two characters that are not hex digits, such as %ZZ. We tried it and the tool pointed at the sequence %ZZ itself.
- A link copied incompletely, cut off right after a % or after only one of its digits.
- Text where someone mixed encoded and unencoded parts, leaving an ordinary % behind.
In each case the tool does not guess what was meant; it gives the position and the sequence so you can correct it yourself. If the % belongs to the original text, write it as %25.
Ready-made WhatsApp links
This problem comes up a lot with pre-filled message links that mention an offer and a discount. If you are building a chat link with a message, the WhatsApp link generator encodes the message text for you, so there is no need to encode it by hand.
Common questions
Should I write 'percent' instead of the sign to avoid this?
No need. The sign arrives intact if you encode the text: it travels as %25 inside the link and shows as % to the reader.
Why didn't the tool decode the rest and skip the sign?
Because skipping it could give you text different from what the writer meant, without you noticing. Pointing to the position is clearer.
Is the position counted from zero?
No. The position shown starts at 1 for the first character of the text.
