Index: subversion/tests/cmdline/commit_tests.py
===================================================================
--- subversion/tests/cmdline/commit_tests.py    (revision 32000)
+++ subversion/tests/cmdline/commit_tests.py    (working copy)
@@ -1689,6 +1689,60 @@
                                         '-F', log_msg_path,
                                         iota_path)

+def commit_with_mixed_line_endings(sbox):
+  "commit with log message with mixed EOL"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  expected_status = make_standard_slew_of_changes(wc_dir)
+
+  iota_path = os.path.join(wc_dir, 'iota')
+  log_msg_path = os.path.join(wc_dir, 'log-message')
+
+  # Make a random change, so there's something to commit.
+  svntest.main.file_append(iota_path, 'kebab')
+
+  # Create a log message containing a zero-byte.
+  svntest.main.file_append(log_msg_path, "test\nthis\n\rcase\r\n--This line, and those below, will be ignored--\n")
+
+  # Commit and expect an error.
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        None, None,
+                                        "Error normalizing log message to internal format",
+                                        '-F', log_msg_path,
+                                        iota_path)
+
+def commit_with_mixed_line_endings_in_ignored_part(sbox):
+  "commit with log message with mixed EOL in tail"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  expected_status = make_standard_slew_of_changes(wc_dir)
+
+  iota_path = os.path.join(wc_dir, 'iota')
+  log_msg_path = os.path.join(wc_dir, 'log-message')
+
+  # Make a random change, so there's something to commit.
+  svntest.main.file_append(iota_path, 'cheeseburger')
+
+  # Create a log message containing a zero-byte.
+  svntest.main.file_append(log_msg_path, "test\n--This line, and those below, will be ignored--\nfoo\r\nbar\nbaz\n\r")
+
+  # Create expected state.
+  expected_output = svntest.wc.State(wc_dir, {
+    'iota' : Item(verb='Sending'),
+    })
+  expected_status.tweak('iota', wc_rev=2, status='  ')
+
+  # Commit the one file.
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None,
+                                        iota_path)
+
 def from_wc_top_with_bad_editor(sbox):
   "commit with invalid external editor cmd"

@@ -2545,6 +2599,8 @@
               failed_commit,
               commit_out_of_date_deletions,
               commit_with_bad_log_message,
+              commit_with_mixed_line_endings,
+              commit_with_mixed_line_endings_in_ignored_part,
               from_wc_top_with_bad_editor,
               mods_in_schedule_delete,
               Skip(tab_test, is_non_posix_os_or_cygwin_platform),
Index: subversion/svn/util.c
===================================================================
--- subversion/svn/util.c       (revision 32000)
+++ subversion/svn/util.c       (working copy)
@@ -655,16 +655,16 @@
     {
       svn_string_t *log_msg_string = svn_string_create(lmb->message, pool);

-      SVN_ERR_W(svn_subst_translate_string(&log_msg_string, log_msg_string,
-                                           lmb->message_encoding, pool),
-                _("Error normalizing log message to internal format"));
-
       *log_msg = log_msg_string->data;

       /* Trim incoming messages the EOF marker text and the junk that
          follows it.  */
       truncate_buffer_at_prefix(NULL, (char*)*log_msg, EDITOR_EOF_PREFIX);

+      SVN_ERR_W(svn_subst_translate_string(&log_msg_string, log_msg_string,
+                                           lmb->message_encoding, pool),
+                _("Error normalizing log message to internal format"));
+
       return SVN_NO_ERROR;
     }
 #ifdef AS400
