Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ruby 2.7 and earlier (Pre-Ruby 3000/Ruby 3.0) Text Encoding / Charsets / Character Sets

10 views
Skip to first unread message

awefawef...@prodigy.net

unread,
Oct 7, 2021, 12:36:08 PM10/7/21
to
Hello,

In ruby versions earlier than Ruby 3.0 / Ruby 3000, was there a standard
text encoding or was it per-platform? Here is an example from Windows
running Ruby 2.6.8 without the RUBYOPT=Eutf-8 option shows the following:

irb(main):001:0> 'hi'.encoding
=> #<Encoding:IBM437>
irb(main):002:0> RUBY_VERSION
=> "2.6.8"

Running the same commands in irb on Slackware Linux 14.2 without UTF-8
enabled gives the following result:

irb(main):001:0> 'hi'.encoding
=> #<Encoding:ISO-8859-1>
irb(main):002:0> RUBY_VERSION
=> "2.2.5"

Thanks.
0 new messages