a = 'some string'
b = URI.encode(a) # returns 'some%20string'
c = URI.encode(b) # returns 'some%2520string'
is there a way in ruby by which I can decode 'c' that gets me to 'a' string without decoding twice. My point is that I have some string that are encoded twice and some other that are encoded once. I want a method to automatically decode to normal string automatically identifying the number of time decoded.