I *think* what I wrote will produce an equivalent string, but you should definitely test it thoroughly.  =)