[#80974] [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit — ko1@...
Issue #13517 has been updated by ko1 (Koichi Sasada).
4 messages
2017/05/02
[#81024] Re: [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit
— SASADA Koichi <ko1@...>
2017/05/07
sorry for late response.
[#80996] [Ruby trunk Feature#13544] Allow loading an ISeqs sequence directly from a C extension without requiring buffer is in an RVALUE — sam.saffron@...
Issue #13544 has been reported by sam.saffron (Sam Saffron).
3 messages
2017/05/04
[#81016] [Ruby trunk Bug#13526] Segmentation fault at 0x0055c2e58e8920 ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] — s.wanabe@...
Issue #13526 has been updated by wanabe (_ wanabe).
3 messages
2017/05/07
[#81048] Re: [ruby-cvs:65788] normal:r58614 (trunk): rb_execution_context_t: move stack, stack_size and cfp from rb_thread_t — SASADA Koichi <ko1@...>
It causes compile error on raspi 3.
3 messages
2017/05/09
[#81201] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle — "U.NAKAMURA" <usa@...>
Hi, Eric
4 messages
2017/05/16
[#81202] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle
— Eric Wong <normalperson@...>
2017/05/16
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#81427] Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534) — SASADA Koichi <ko1@...>
Hi,
6 messages
2017/05/28
[#81428] Re: Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534)
— Eric Wong <normalperson@...>
2017/05/28
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:80966] [Ruby trunk Feature#13532][Assigned] Enable :encoding key or open-uri (open()) similar as to how File.read() and File.readlines() already allow for
From:
shyouhei@...
Date:
2017-05-02 00:16:24 UTC
List:
ruby-core #80966
Issue #13532 has been updated by shyouhei (Shyouhei Urabe).
Status changed from Open to Assigned
Assignee set to akr (Akira Tanaka)
FYI bare (non-uri) open has encoding: option.
```
irb(main):001:0> File.open("tmp.txt", encoding: Encoding::Windows_31J) {|fp| fp.external_encoding }
=> #<Encoding:Windows-31J>
```
----------------------------------------
Feature #13532: Enable :encoding key or open-uri (open()) similar as to how File.read() and File.readlines() already allow for
https://bugs.ruby-lang.org/issues/13532#change-64631
* Author: shevegen (Robert A. Heiler)
* Status: Assigned
* Priority: Normal
* Assignee: akr (Akira Tanaka)
* Target version:
----------------------------------------
Hello ruby core team and everyone else.
I lately had some odd behaviour and mixing of Encodings in my
scripts.
I had a better look and realized that open-uri would return
UTF-8 whereas my other scripts would use another encoding. So
far so good, no big deal, I can just change the encoding. But
I was not aware of this.
I then looked at the documentation and found it to be lacking:
https://ruby-doc.org/stdlib-2.4.1/libdoc/open-uri/rdoc/OpenURI.html
Compare this to File.readlines():
https://ruby-doc.org/core-2.4.1/IO.html#method-c-readlines
File.readlines() also tells you how many arguments can be
passed.
(1) So my first suggestion is - could some kind soul please also
enable this for open-uri?
The major reason for me filing this feature request, is about
encoding support though, via open-uri.
File.open() and File.readlines() both allow an :encoding key
to be passed. This is very nifty, I use it a lot and it works
very well.
open-uri or rather its open() functionality, allows you to
pass in a Hash but this Hash has no :encoding key.
Example:
open("http://www.ruby-lang.org/", encoding: 'ISO-8859-1')
Error:
ArgumentError: unrecognized option: encoding
Could this perhaps be added for symmetry and consistency,
so that open() from open-uri will behave like File.read()
and File.readlines() would? E. g. an example for the latter
would be.
File.readlines('foobar.rb', :encoding => 'ISO-8859-1')
The very same syntax could also be used for open() of
open-uri.
Thanks for reading!
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>