Is this expected?
File.read(‘picture.jpg’).encoding
=> #Encoding:UTF-8Encoding.default_external
=> #Encoding:UTF-8
Shouldn’t default_external be “ASCII-8BIT”? Who is setting my
default_external?
Sorry a but confused.
Thanks!
-rp
Is this expected?
File.read(‘picture.jpg’).encoding
=> #Encoding:UTF-8Encoding.default_external
=> #Encoding:UTF-8
Shouldn’t default_external be “ASCII-8BIT”? Who is setting my
default_external?
Sorry a but confused.
Thanks!
-rp
Roger P. wrote:
Is this expected?
File.read(‘picture.jpg’).encoding
=> #Encoding:UTF-8Encoding.default_external
=> #Encoding:UTF-8Shouldn’t default_external be “ASCII-8BIT”? Who is setting my
default_external?Sorry a but confused.
Thanks!
-rp
"The default external encoding is something different: this is the
encoding that Ruby uses by default when reading from files and streams.
The default external encoding is global to the Ruby process and does not
change from file to file. Normally, the default external encoding is set
based on the locale that your computer is configured to. " - From “the
ruby programming language” book
Hi,
In message “Re: default encoding UTF 8?”
on Tue, 25 May 2010 01:10:19 +0900, Roger P.
[email protected] writes:
|Is this expected?
|
|>> File.read(‘picture.jpg’).encoding
|=> #Encoding:UTF-8
|>> Encoding.default_external
|=> #Encoding:UTF-8
Yes.
|Shouldn’t default_external be “ASCII-8BIT”? Who is setting my
|default_external?
It’s set according to your locale setting.
matz.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs