# File lib/mspec/helpers/encode.rb, line 10
10:   def encode(str, encoding)
11:     unless str.is_a? String and encoding.is_a? String
12:       raise ArgumentError, "encoding name must be a String"
13:     end
14: 
15:     if FeatureGuard.enabled? :encoding
16:       str.force_encoding encoding
17:     end
18: 
19:     str
20:   end