summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/rbot/core/utils/wordlist.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbot/core/utils/wordlist.rb b/lib/rbot/core/utils/wordlist.rb
index 875a9756..fc341578 100755
--- a/lib/rbot/core/utils/wordlist.rb
+++ b/lib/rbot/core/utils/wordlist.rb
@@ -33,7 +33,8 @@ class Wordlist
File.readlines(wordlist_path)
end
- wordlist.map! { |l| l.strip }
+ # wordlists are assumed to be UTF-8, but we need to strip the BOM, if present
+ wordlist.map! { |l| l.sub("\xef\xbb\xbf",'').strip }
wordlist.reject do |word|
word =~ /\s/ && !opts[:spaces] ||
word.empty?