I have an environment variable along the lines of:
MY_VALUE: "EFINbA\u003d\u003d\n"
When I read it through ruby it is returned as:
ENV['MY_VALUE']
=> "EFINbA\\u003d\\u003d\\n"
... but only on Heroku, not on Mac (where it was set through a local_env.yml file, admittedly)
So first of all, I just don't understand why it is doing that.
Secondly, when I attempt to remove the \ and replace them with \, I have found nothing that works.
Although: ENV['MY_VALUE'].gsub("\","x") => "EFINbAxu003dxu003dxn"
This: ENV['MY_VALUE'].gsub("\","\")
... doesn't work because the last double-quote is escaped, while:
ENV['MY_VALUE'].gsub("\\","\\")
... effectively does nothing at all.
Evidently I am missing something basic here, and it's too late in the day for me to spot it.
Thanks.