[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive
From:
nobu@...
Date:
2016-02-07 09:51:09 UTC
List:
ruby-core #73730
Issue #12034 has been updated by Nobuyoshi Nakada.
Eric Wong wrote:
> How about fall back to ASCII-8BIT if we detect broken code range?
It may be desirable or undesirable, as it can cause unexpected failure later.
> ```diff
> + link = "\xde\xad\xbe\xef".b
> + File.symlink(link, 'foo')
> + str = File.readlink('foo')
> + assert_predicate str, :valid_encoding?, bug12034
> + assert_equal link, str, bug12034
Anyway, "\xde\xad\xbe\xef" is a valid string in some encodings, e.g., EUC-JP, ISO-8859-1, and so on.
Especially in ISO-8859 encodings, any bytes are valid.
----------------------------------------
Feature #12034: RegExp does not respect file encoding directive
https://bugs.ruby-lang.org/issues/12034#change-56916
* Author: Vit Ondruch
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
~~~
$ cat regexp-encoding.rb
# -*- encoding: binary -*-
puts ''.encoding
puts //.encoding
$ ruby regexp-encoding.rb
ASCII-8BIT
US-ASCII
~~~
The RegExp should have ASCII-8BIT encoding IMO.
Actually there is something different how Ruby 2.3 behaves with regards to encoding, since I cannot compile raindrops gem with Ruby 2.3 anymore due to this test error:
~~~
1) Error:
TestLinux#test_unix_resolves_symlinks:
RegexpError: /.../n has a non escaped non ASCII character in non ASCII-8BIT script
/builddir/build/BUILD/rubygem-raindrops-0.13.0/usr/share/gems/gems/raindrops-0.13.0/lib/raindrops/linux.rb:57:in `unix_listener_stats'
/builddir/build/BUILD/rubygem-raindrops-0.13.0/usr/share/gems/gems/raindrops-0.13.0/test/test_linux.rb:97:in `test_unix_resolves_symlinks'
~~~
This is the line where it fails:
http://bogomips.org/raindrops.git/tree/lib/raindrops/linux.rb#n57
--
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>