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

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.

  • Comment on Re^12: Save form data with decoded URL chars

Replies are listed 'Best First'.
Re^13: Save form data with decoded URL chars
by Anonymous Monk on Aug 09, 2012 at 10:08 UTC

    Don't use save, the sole purpose of save is to write a CGI object to disk, and read it back from disk

    Don't parse a ->save'd to get data out of it, that is a job for CGI.pm

    You already have a CGI object, use it, use the param method to get the posted form data, then use open and http://search.cpan.org/perldoc/Text::CSV#print to write it as CSV, all quoted escaped and comma seperated