From: Mark Hubbart Date: 2004-04-27T03:14:43+09:00 Subject: Re: String.undump On Apr 26, 2004, at 5:59 AM, Szymon Drejewicz wrote: > > Is there any way to "undump" dumped string? > > => stringWithNonPrintingChars = "Łódź" > => a = [32,stringWithNonPrintingChars].inspect > => puts a > "[32, \"\\243\\363d\\274\"]" > => puts a.undump > Łódź if you need to do it inline: [1,2].inspect.instance_eval{eval self} == [1,2] ==>true or write a method: class String def undump() eval(self) end end ==>nil [1,2].inspect.undump == [1,2] ==>true cheers, --Mark