diff -Naur scmbug.old2/lib/Scmbug/Daemon/Bugzilla.pm scmbug/lib/Scmbug/Daemon/Bugzilla.pm
--- scmbug.old2/lib/Scmbug/Daemon/Bugzilla.pm	2011-03-13 09:34:04.844477140 +0200
+++ scmbug/lib/Scmbug/Daemon/Bugzilla.pm	2011-03-13 10:10:39.528477081 +0200
@@ -327,6 +327,11 @@
         # Must load the Bugzilla package before any of its functions are used.
         eval "use Bugzilla";
         eval "use Bugzilla::BugMail";
+
+	Bugzilla->usage_mode( Bugzilla::Constants->USAGE_MODE_CMDLINE );
+
+	# Reset encoding to prevent fork crash on Windows
+	reset_output_encoding();
     }
 
     # This is direct modification to bugzilla's internal variables
@@ -1804,4 +1809,15 @@
 }
 
 
+#
+# Reset stdout and stderr encoding. Required to avoid fork crash on
+# Windows.
+sub reset_output_encoding {
+	binmode( STDOUT );
+	binmode( STDOUT, ':utf8' );
+	binmode( STDERR );
+	binmode( STDERR, ':utf8' );
+}
+
+
 1;
