[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
9 messages
2014/10/07
[#65458] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/07
[email protected] wrote:
[#65502] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/08
Eric Wong <[email protected]> wrote:
[#65538] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/09
Eric Wong <[email protected]> wrote:
[#65549] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— SASADA Koichi <ko1@...>
2014/10/09
On 2014/10/09 11:04, Eric Wong wrote:
[#65551] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/09
SASADA Koichi <[email protected]> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
3 messages
2014/10/07
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
7 messages
2014/10/09
[#65560] Re: is there a name for this?
— Nobuyoshi Nakada <nobu@...>
2014/10/09
On 2014/10/09 20:41, Xavier Noria wrote:
[#65561] Re: is there a name for this?
— Xavier Noria <fxn@...>
2014/10/09
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <[email protected]> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
3 messages
2014/10/09
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, [email protected] wrote:
5 messages
2014/10/16
[#65742] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race
— Eric Wong <normalperson@...>
2014/10/16
Nobuyoshi Nakada <[email protected]> wrote:
[#65750] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race
— Tanaka Akira <akr@...>
2014/10/16
2014-10-16 12:48 GMT+09:00 Eric Wong <[email protected]>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
3 messages
2014/10/16
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
3 messages
2014/10/20
[ruby-core:65986] [ruby-trunk - Bug #10239] [Assigned] Regexp.quote() and default encoding
From:
nagachika00@...
Date:
2014-10-29 08:39:03 UTC
List:
ruby-core #65986
Issue #10239 has been updated by Tomoyuki Chikanaga.
Category set to doc
Status changed from Open to Assigned
Assignee set to Zachary Scott
Target version set to current: 2.2.0
I think this is intended behavior.
----------------------------------------
Bug #10239: Regexp.quote() and default encoding
https://bugs.ruby-lang.org/issues/10239#change-49719
* Author: Robert A. Heiler
* Status: Assigned
* Priority: Low
* Assignee: Zachary Scott
* Category: doc
* Target version: current: 2.2.0
* ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Hello,
I am not sure if this is a bug, or unexpected behaviour (for me).
I will simply report it, I am sure you guys know how and if to
handle this anyway.
I believe it should be documented at least in the official documentation
if it is not a bug.
The situation is that I have several strings with mixed encodings.
Some will have automatically UTF8, some US-ASCII, and yet some
others will have ASCII-8BIT.
I noticed that Regexp.quote() change the encoding of the string
in question in the same project unfortunately, and no way to
change that (as some of that gets set from the outside world
to me).
Here is proof for Regexp.quote() changing the encoding, where
x is my test variable - a string:
x = "abc"; x.encoding # => #<Encoding:US-ASCII>
x.encode!('ASCII-8BIT'); x.encoding # => #<Encoding:ASCII-8BIT>
Ok, all works fine, it defaulted to US-ASCII but is not
ASCII-8BIT.
Next:
test = Regexp.quote(x); test.encoding # => #<Encoding:US-ASCII>
Suddenly the new string that is returned has another encoding.
I looked at the documentation:
http://www.ruby-doc.org/core-2.1.2/Regexp.html#method-c-quote
But there is no mention that this method would return a new
String object with a different encoding.
I would have expected it to not change the encoding of the
argument-string object there.
Perhaps the documentation could mention that it will ignore
the original encoding of the string given?
--
https://bugs.ruby-lang.org/