summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-07-05 11:20:27 +0200
committerGeremia Taglialatela <[email protected]>2023-07-05 11:20:27 +0200
commitb1475439f462fc065f0f9564d5b72dc62967e233 (patch)
treeb037216c727133c64ebe37ed089092532306a979
parent692be9e99e0a76d5f6d0b0527466998ca558fe96 (diff)
downloadcaxlsx-b1475439f462fc065f0f9564d5b72dc62967e233.tar.gz
caxlsx-b1475439f462fc065f0f9564d5b72dc62967e233.zip
Use encoding constant instead of hardcoded string
Ref: https://ruby-doc.org/core-2.6.10/Encoding.html#class-Encoding-label-Changing+an+encoding
-rw-r--r--lib/axlsx/util/constants.rb2
1 files changed, 1 insertions, 1 deletions
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