diff --git a/Changes b/Changes index 5ba46c2bcc..3a185bf11b 100644 --- a/Changes +++ b/Changes @@ -44,6 +44,7 @@ This file documents the revision history for Perl extension Mojolicious. - Fixed automatic reloading for external templates. - Fixed after_build_tx plugin hook callback order. - Fixed a small under bug in Mojolicious::Lite. + - Fixed logging of UTF-8 errors. (und3f) 0.999929 2010-08-17 00:00:00 - Removed OS X resource fork files. diff --git a/lib/Mojo/Log.pm b/lib/Mojo/Log.pm index 5bb267c323..0fb9637215 100644 --- a/lib/Mojo/Log.pm +++ b/lib/Mojo/Log.pm @@ -68,7 +68,8 @@ sub log { return $self unless $level && $self->is_level($level); my $time = localtime(time); - my $msgs = join "\n", @msgs; + my $msgs = join "\n", + map { utf8::is_utf8 $_ ? $_ : utf8::encode $_} @msgs; # Caller my ($pkg, $line) = (caller())[0, 2];