mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
String#encode accepts an Encoding
This commit is contained in:
parent
121b6ae9e2
commit
74753d3870
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ module Haml
|
|||
if str.valid_encoding?
|
||||
# Get rid of the Unicode BOM if possible
|
||||
if str.encoding.name =~ /^UTF-(8|16|32)(BE|LE)?$/
|
||||
return str.gsub(Regexp.new("\\A\uFEFF".encode(str.encoding.name)), '')
|
||||
return str.gsub(Regexp.new("\\A\uFEFF".encode(str.encoding)), '')
|
||||
else
|
||||
return str
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue