how can i unescape the results from inspect method. I tried with URI but
not lucky
x={"a"=>"aaaaaaaaaaaaaa","b"=>"ññññækkksdlæp@"}
puts URI.unescape(x.inspect)
···
--
Posted via http://www.ruby-forum.com/.
how can i unescape the results from inspect method. I tried with URI but
not lucky
x={"a"=>"aaaaaaaaaaaaaa","b"=>"ññññækkksdlæp@"}
puts URI.unescape(x.inspect)
--
Posted via http://www.ruby-forum.com/.
Why do you expect that to work at all? URI escaping != #inspect format.
Cheers
robert
On Fri, Oct 18, 2013 at 4:15 PM, Mario Ruiz <lists@ruby-forum.com> wrote:
how can i unescape the results from inspect method. I tried with URI but
not luckyx={"a"=>"aaaaaaaaaaaaaa","b"=>"ññññækkksdlæp@"}
puts URI.unescape(x.inspect)
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
The problem is I have values escaped with inspect stored on Database and
later on I need to recover them and unescape them to be used... any
idea?
--
Posted via http://www.ruby-forum.com/.
So.... no possible to be unescaped?
Robert Klemme wrote in post #1124848:
On Fri, Oct 18, 2013 at 4:15 PM, Mario Ruiz <lists@ruby-forum.com> > wrote:
--
Posted via http://www.ruby-forum.com/\.
The approach is broken: #inspect's format is not intended for
serialization. You need to use a different mechanism to serialize
your objects into and out of the database:
- Marshal (binary)
- YAML (text)
- some form of XML serialization
- some form of JSON serialization
Cheers
robert
On Tue, Oct 29, 2013 at 5:06 PM, Mario Ruiz <lists@ruby-forum.com> wrote:
The problem is I have values escaped with inspect stored on Database and
later on I need to recover them and unescape them to be used... any
idea?
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/