Skip to content

Commit 24c2d34

Browse files
committed
Use force_encoding rather than pack
1 parent 50b33d5 commit 24c2d34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/babosa/identifier.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def normalize_utf8!
269269
# @return String
270270
def tidy_bytes!
271271
@wrapped_string = @wrapped_string.scrub do |bad|
272-
tidy_byte(*bad.bytes).flatten.compact.pack("C*").codepoints.pack("U*")
272+
tidy_byte(*bad.bytes).flatten.compact.pack("C*").force_encoding("UTF-8")
273273
end
274274
end
275275

0 commit comments

Comments
 (0)