summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/workbook.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb
index 1a2f0488..da36e9a0 100644
--- a/lib/axlsx/workbook/workbook.rb
+++ b/lib/axlsx/workbook/workbook.rb
@@ -221,8 +221,8 @@ module Axlsx
# @param [String] name The name of the sheet you are looking for
# @return [Worksheet] The sheet found, or nil
def sheet_by_name(name)
- index = @worksheets.index { |sheet| sheet.name == name }
- @worksheets[index] if index
+ encoded_name = Axlsx.coder.encode(name)
+ @worksheets.find { |sheet| sheet.name == encoded_name }
end
# Creates a new Workbook.