As i stated in my pevious i tried to run the test cgi script you gave me so to see if i understood it but i'm getting a Premature end of script headers: testmenu.pl and hence i cant run it.
Is there a chance for a string to be in some encoding then be converted to 'utf8' and still appear properly to screen?
I'm sure it can't cause i tested with the filenames and try to convert them from 'cp1253' to 'utf-8' but then when i tried to display them on web page they looked like chinese :)
Would like to ask you though what exactly this phrase means: The string "nikos" for example is encoded in 'greek-iso' or the string "nikos" is encoded in 'utf-8'. I mean what does it literally mean?
Does it signify the practical way this string is gonna be stored in the hdd/memory in terms of bytes?
For example the char 'n' in greek-iso will be 10010000 while the char 'n' in utf-8 will be stored as 10101010 01011010 ?
Which means we are using different bytes in each case for storing?
Does this explain my question above of why when i tried to read the filenames as cp1253 and convert them to utf8 never got converted correctly and hence been displayed correctly? Because i tried to read them in a different manner other of the one the filesystem used to store them on the hdd
So to put it clearly: the problem with matching the parameter string from the web form with the original file name is that perl has no way of knowing that the parameter string should be interpreted as a utf8 byte sequence. You need to add a line of code that explicitly tells perl to interpret the parameter string as utf8 characters.I finally understood your point and the reason a fell for that wrong assumption was that the statement print header( -charset=>'utf-8' ); led me to believe that perl will handle any incoming/outgoing variable as 'utf-8' chars. But iam guessing this statemnt only tells the clients browser what encoding to use when displaying stuff and NOT what encoding to use when send over stuff
But if the client's browser aint smart enough to send form strings back to the sending script using the same encoding as the sending script does, HOW am i supposed to add a line to my index.pl telling perl to take the unknown encoded string and convert it to 'utf-8'?
I mean i dont know the source encoding the browser used to send me the paramater sting back. How will i detect it? More trouble for the programmer that apart from the fact of different encodings now he has to detect them tooEncode::from_to($param('select'), 'unknown_enc', utf-8');
In reply to Re^12: somethign wrong with the sumbit
by Nik
in thread somethign wrong with the sumbit
by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |