Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

encoding
system
ruby
communitycreator

How to get all the encodings present in your system in Ruby

okwudili onyejiaku

Overview

We can use the list property of the Encoding class to know the encodings present in our computer system. This property displays a long list of encodings loaded on our computer.

Syntax

Encoding.list

Return value

A list of encodings present in our system is presented.

Code example

puts Encoding.list
Code to print all encodings present in our system

Code explanation

Line 1: We list the encodings present in this current system environment using the list property of the Encoding class. We then display the output using the puts functionality.

RELATED TAGS

encoding
system
ruby
communitycreator
RELATED COURSES

View all Courses

Keep Exploring