Help for this page
BEGIN { # Wrong, and the cause of the OP's problem. See my reply to the OP. ... # Necessary to encode error messages for the log. binmode(STDERR, ':encoding(UTF-8)'); }
BEGIN { binmode(STDIN); # Form data binmode(STDOUT, ':encoding(UTF-8)'); # HTML binmode(STDERR, ':encoding(UTF-8)'); # Error messages }