find

Encoding.find(string) â enc
Class Public methods

Search the encoding with specified name. name should be a string.

Encoding.find("US-ASCII")  #=> #<Encoding:US-ASCII>

Names which this method accept are encoding names and aliases including following special aliases

âexternalâ

default external encoding

âinternalâ

default internal encoding

âlocaleâ

locale encoding

âfilesystemâ

filesystem encoding

An ArgumentError is raised when no encoding with name. Only Encoding.find("internal") however returns nil when no encoding named âinternalâ, in other words, when Ruby has no default internal encoding.

doc_ruby_on_rails
2015-04-04 21:26:00
Comments
Leave a Comment

Please login to continue.