4

What is the Unicode encoding for Ruby? I know that most languages are encoded in UTF-16 like Java. I was wondering what Ruby was encoded in. I've checked the documentation, but can't find any reference to it.

1 Answer 1

5

There are lots of encodings supported in Ruby. Try typing the following in irb:

Encoding.name_list

Also see these blog entries:

Ruby 1.9 String

Ruby 1.9: default encodings

Sign up to request clarification or add additional context in comments.

3 Comments

(You didn't specify version, so i assumed 1.9.)
Do you know what the default encoding is?
@VictorKmita : it depends. The blog entry i linked above (Ruby 1.9: default encodings) is the most clear explanation that i've seen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.