From df5d702633a8231b95c609a37034db0112862685 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 31 Aug 2021 12:40:14 +0800 Subject: [PATCH] fix error --- update_event_news.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update_event_news.rb b/update_event_news.rb index 951470b..069e085 100644 --- a/update_event_news.rb +++ b/update_event_news.rb @@ -48,7 +48,8 @@ def add_css_style_for_block(c,head_key,value_key,css_key) end def update_event_news_template(folder) Dir["#{folder}modules/event_news/*.html.erb"].each do |f| - c = File.open(f,'r'){|f1| f1.read} + c = File.open(f,'r'){|f1| f1.read}.encode("UTF-8", "UTF-8", invalid: :replace, replace: "???") + next if (c.include?("???") rescue true) flag1,c = add_css_style_for_block(c,'speaker-head','speaker','speaker-css') flag2,c = add_css_style_for_block(c,'host-head','host','host-css') if flag1 || flag2