Reputation:
I heard that Ruby 2.1 uses UTF-8 as default encoding. But Encoding.default_external
returns US-ASCII
. Is this a usual case, or suggesting something wrong with my environment?
Upvotes: 2
Views: 1033
Reputation: 122383
UTF-8 is used as the default encoding of the source file since Ruby 2.0. Note that it's not the same as the external encoding. Encoding.default_external
depends on the locale, for instance, LANG
environment variable on Unix.
The default external encoding is initialized by the locale or
-E
option.
Upvotes: 3