From b1475439f462fc065f0f9564d5b72dc62967e233 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Wed, 5 Jul 2023 11:20:27 +0200 Subject: Use encoding constant instead of hardcoded string Ref: https://ruby-doc.org/core-2.6.10/Encoding.html#class-Encoding-label-Changing+an+encoding --- lib/axlsx/util/constants.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/axlsx/util/constants.rb b/lib/axlsx/util/constants.rb index 1c5c0033..70951eb8 100644 --- a/lib/axlsx/util/constants.rb +++ b/lib/axlsx/util/constants.rb @@ -398,7 +398,7 @@ module Axlsx # x0D Carriage Return (Cr) # x09 Character Tabulation # @see https://www.codetable.net/asciikeycodes - pattern = "\x0-\x08\x0B\x0C\x0E-\x1F".encode('UTF-8') + pattern = "\x0-\x08\x0B\x0C\x0E-\x1F".encode(Encoding::UTF_8) # The regular expression used to remove control characters from worksheets CONTROL_CHARS = pattern.freeze -- cgit v1.2.3