You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2021/02/27 16:40:10 UTC

[whimsy] branch master updated: This seems to convert to UTF-8 with replace

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c1e364  This seems to convert to UTF-8 with replace
8c1e364 is described below

commit 8c1e3644f4007d2193da91001fd880664c2bd0ce
Author: Sebb <se...@apache.org>
AuthorDate: Sat Feb 27 16:40:01 2021 +0000

    This seems to convert to UTF-8 with replace
---
 lib/whimsy/asf/member-files.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/whimsy/asf/member-files.rb b/lib/whimsy/asf/member-files.rb
index 5f71fb4..e30943b 100644
--- a/lib/whimsy/asf/member-files.rb
+++ b/lib/whimsy/asf/member-files.rb
@@ -28,7 +28,7 @@ module ASF
       # Find most recent file:
       nomfile = Dir[File.join(ASF::SVN['Meetings'], '*', name)].max
 
-      File.open(nomfile, mode='rb')
+      File.open(nomfile, mode='rb:UTF-8')
         .slice_before(/^\s*---+--\s*/)
         .drop(2) # instructions and sample block
         .each do |block|
@@ -82,7 +82,7 @@ module ASF
         # for board, the header currentl looks like this:
         # <PUBLIC NAME>
         id = ASF::Person.find_by_name!(hdr) || hdr # default to full name
-        nominee['Public Name'] = hdr.force_encoding(Encoding::UTF_8) # the board file does not have ids, unfortunately
+        nominee['Public Name'] = hdr # the board file does not have ids, unfortunately
         nominees[id] = nominee
       end
       nominees
@@ -91,7 +91,7 @@ module ASF
 end
 
 if __FILE__ == $0
-  ASF::MemberFiles.member_nominees.each {|k,v| p [k, v['Public Name']]}
+  ASF::MemberFiles.member_nominees.each {|k,v| p [k, v['Public Name'], v['Public Name'].encoding]}
   puts "--------------"
-  ASF::MemberFiles.board_nominees.each {|k,v| p [k, v['Public Name']]}
+  ASF::MemberFiles.board_nominees.each {|k,v| p [k, v['Public Name'], v['Public Name'].encoding]}
 end
\ No newline at end of file