FIX: handle charset=windows-1252 in mbox import script (#12832)

FIX: handle charset=windows-1252 in mbox import script (#12832)

Co-authored-by: Loïc Dachary loic@dachary.org

diff --git a/script/import_scripts/mbox/support/indexer.rb b/script/import_scripts/mbox/support/indexer.rb
index dc6e092..47ce3ed 100644
--- a/script/import_scripts/mbox/support/indexer.rb
+++ b/script/import_scripts/mbox/support/indexer.rb
@@ -160,9 +160,7 @@ module ImportScripts::Mbox
       last_line_number = 0
 
       each_line(filename) do |line|
-        line = line.scrub
-
-        if line =~ @split_regex
+        if line.scrub =~ @split_regex
           if last_line_number > 0
             yield raw_message, first_line_number, last_line_number
             raw_message = +''

GitHub sha: e7892df1

This commit appears in #12832 which was approved by gschlager. It was merged by gschlager.