]> source.dussan.org Git - redmine.git/commitdiff
Ruby 3.2: `Changeset.normalize_comments` raises Encoding::CompatibilityError if the...
authorGo MAEDA <maeda@farend.jp>
Mon, 26 Dec 2022 01:36:44 +0000 (01:36 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 26 Dec 2022 01:36:44 +0000 (01:36 +0000)
Patch by Go MAEDA.

git-svn-id: https://svn.redmine.org/redmine/trunk@22000 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/changeset.rb

index b4501b19ee3f78768cca0eb5b490a5519a73ab9c..db55c3e3b30eb9aca6c113018fc7144942a536db 100644 (file)
@@ -296,7 +296,7 @@ class Changeset < ActiveRecord::Base
   class << self
     # Strips and reencodes a commit log before insertion into the database
     def normalize_comments(str, encoding)
-      Changeset.to_utf8(str.to_s.strip, encoding)
+      Changeset.to_utf8(str.to_s, encoding).strip
     end
 
     def to_utf8(str, encoding)