Check Encodings before calling force_encoding in Addressable::URI #341
I'm curious, what are the issue you are facing with the current version?
#254 is about constants, but this PR only touches instance variables, so I don't think it is the same.
The issue with constants is sort of an extension of the issue we have right now since we are normalizing the
Without this check, after the strings go through normalization, they are in their final state and do not mutate unless something tries to reassign one of the.
calling force_encoding on them This prevents unnecessary mutation of these variables when already set and appropriately encoded. Necessary for our use case as we freeze our Addressable::URI objects to ensure they don't get changed when passed around