Wanted to add an alias for one of the charsets that PayPal may use for its IPN (Instant Payment Notification).
This is silently ignored:
Encoding.aliases["x-mac-greek"] = "macGreek"
This doesn't work, either:
Encoding.aliases.update("x-mac-greek" => "macGreek")
Any other suggestions?
I don't think this is possible. If you look at the source for the
aliases
method you can see that it creates a new hash each time it's called, with the aliases copied into from the internal representation.From what I can see it doesn't look like there's any way to modify this internal data from a Ruby program.
Perhaps you just need to check the string you get from PayPal before trying to use it as an encoding.