Sorry, I'm not sure about encoding. All I can say is that the perl code is save as plain text and user input is via a basic html <input type="text"> box inside a <form> with no enctype specified. The HTML is in latin1 ISO-8859-1.
As for entering directly into the Database, as I said, entering from the console produces prefect results, therefore it is nothing to do with the database as such, just the way in which the data gets to it via Perl and DBI.