Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Encoding#ascii_compatible?

() -> bool
enc.ascii_compatible? → true or false

Returns whether ASCII-compatible or not.

Example
Encoding::UTF_8.ascii_compatible?     #=> true
Encoding::UTF_16BE.ascii_compatible?  #=> false
See also .name_list #dummy? .locale_charmap #inspect also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0