Project

General

Profile

Actions

Bug #15044

closed

ENV encoding not UTF-8 by default

Added by lowang (Przemyslaw Wroblewski) about 6 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
[ruby-core:88734]

Description

$ irb
2.5.1 :001 > 'secret'.encoding
 => #<Encoding:UTF-8>
2.5.1 :002 > ENV['PASS'] = 'secret'; ENV['PASS'].encoding
 => #<Encoding:US-ASCII>
2.5.1 :009 > ENV['PASS'] = 'Ł'
 => "\u0141"
2.5.1 :010 > ENV['PASS'].encoding
 => #<Encoding:ASCII-8BIT>

I would expect all encodings to be UTF-8 at all times

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0