Encoding::Converter.asciicompat_encoding(string) â encoding or nil
Encoding::Converter.asciicompat_encoding(encoding) â encoding or nil
Encoding::Converter.asciicompat_encoding(encoding) â encoding or nil
Class Public methods
Returns the corresponding ASCII compatible encoding.
Returns nil if the argument is an ASCII compatible encoding.
âcorresponding ASCII compatible encodingâ is an ASCII compatible encoding which can represents exactly the same characters as the given ASCII incompatible encoding. So, no conversion undefined error occurs when converting between the two encodings.
Encoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP> Encoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8> Encoding::Converter.asciicompat_encoding("UTF-8") #=> nil
Please login to continue.