Looks like it’s not encoding the single quotes. Maybe it doesn’t because it’s probably using encodeURIComponent which I’m finding does not encode certain characters because they don’t need to be.
Is it causing issues down the line? If so, you could run the encoded result through a template column to replace the single quotes with %27.
You could also try this with a javascript column if you want to encode it with just one column.