Hej Anonimous monk and thanks for your reply,
The problem is that my original csv file is ISO-8859-1 encoded and that all clients that will use this script will use ISO-8859-1 on their browsers. I did this (exactly that you showed me before :-D ) :
but that means I have to open a file again, run through subroutine, save it to another file and then close and unlink and rename and so on.sub URLDekod { my $URLkodad = $_[0]; $URLkodad =~ tr/+/ /; $URLkodad =~ s/%([a-fA-F0-9]{2,2})/chr(hex($1))/eg; return $URLkodad; }
I was just looking for TMTOWTDI from more experienced people that probably is much shorter then my solution (having in mind simple fact that I have som problems by taking C out of my head).
This is what I did after saving file
open (TEMP, "<$tempfil") or die "Kan inte \xF6ppna filen $kontorfil"; open (NYF, "+>$nyfil") or die "Kan inte \xF6ppna filen $nyfil"; flock (NYF,2) or die $!; while (<TEMP>) { print NYF URLDekod($_); close TEMP; close NYF; }
Any better TMTOWTDI is highly appreciated.
In reply to Re^2: Save form data with decoded URL chars
by SerZKO
in thread Save form data with decoded URL chars
by SerZKO
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |