Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^9: Save form data with decoded URL chars

by Anonymous Monk
on Aug 09, 2012 at 08:36 UTC ( #986446=note: print w/ replies, xml ) Need Help??


in reply to Re^8: Save form data with decoded URL chars
in thread Save form data with decoded URL chars

For example, why do you have 2 equal signs on your output ?

Its your output too.

Look at the code, its because the data contains equal signs and newlines, and if you undo the serialization that CGI->save does, then you've corrupted your data (ro is no longer qq{=sh\nam=bo\n}, its only =sh, but now there is an extra parameter am with the value bo -- both newlines go missing )

And then that part that I would have to create a new cgi...

WHAT?!


Comment on Re^9: Save form data with decoded URL chars
Re^10: Save form data with decoded URL chars
by SerZKO (Beadle) on Aug 09, 2012 at 09:06 UTC
    This : "...save is a CGI.pm serialization method, if you want to read the file again, use CGI.pm's new, ..."

    What do you mean by undo serialization ? Go back on browser or ?

      Maybe you want to follow the Anonymous Monk's link to "serialization"? To undo serialization would mean to reverse the process of serializing data.

      Maybe you can explain to us what overarching problem you're trying to solve? Saving requests to a file is a measure I've only used for debugging CGI scripts.

        Hej Corion and thanks for your reply !

        As I've already wrote I'm saving a form data in a .csv file in order to manipulate it later on (say that I'll add some *ix commands later on to every record in a file). The thing is that when I use $qry->save, I get key=value pairs saved with URL encoded characters. I then manipulate that file to get it "back" to CSV format, but all of my Swedish letters (ISO-8859-1 formated from the beginning) are URL formated characters now.

        I did then (after help from Anonimous Monk(s)) a subroutine which can manipulate the file once more to get proper formating for Swedish letters, but I was just asking if it was possible (somehow) to get characters URL decoded before file is saved.

        Now Anonimous Monk made a great effort trying to explain to me some things, but I'm sorry, I'm just too stupid to understand it.

        And because time is running and I have a work to do at my workplace (which besides has nothing to do with programming) I've chosen to manipulate a file one more time and run it through my subroutine that will get Swedish letters back in the right format.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986446]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2014-08-20 20:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls