[#23132] [Bug #1357] Fixing variables into specific CPU registers deemed overrated & may disturb compilers' optimizers — Ollivier Robert <redmine@...>
Bug #1357: Fixing variables into specific CPU registers deemed overrated & may disturb compilers' optimizers
[#23154] [Bug #1363] Wrong value for Hash of NaN — Heesob Park <redmine@...>
Bug #1363: Wrong value for Hash of NaN
Hi,
Hi,
Yukihiro Matsumoto wrote:
[#23168] [Bug #1367] flatten(0) is not consistent with flatten(), flatten(1), etc. — Paul Lewis <redmine@...>
Bug #1367: flatten(0) is not consistent with flatten(), flatten(1), etc.
Issue #1367 has been updated by Paul Lewis.
[#23174] [Feature #1371] FTPS Implicit — Daniel Parker <redmine@...>
Feature #1371: FTPS Implicit
[#23193] Regexp Encoding — James Gray <james@...>
I'm trying to document the Encoding Regexp objects receive for the
[#23194] [Feature #1377] Please provide constant File::NOATIME — Johan Walles <redmine@...>
Feature #1377: Please provide constant File::NOATIME
[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>
Dear Ruby developers and users!
Wolfgang N叩dasi-Donner wrote:
Wolfgang N叩dasi-Donner wrote:
Michael Neumann schrieb:
[#23252] [Bug #1392] Object#extend leaks memory on Ruby 1.9.1 — Muhammad Ali <redmine@...>
Bug #1392: Object#extend leaks memory on Ruby 1.9.1
[#23267] StringIO: RubySpec violation — Hongli Lai <hongli@...99.net>
I ran RubySpec against the 1.8.6-p368 release. It seems that
[#23289] [Bug #1399] Segmentation fault is raised when you use a postgres gem — Marcel Keil <redmine@...>
Bug #1399: Segmentation fault is raised when you use a postgres gem
[#23297] Ruby Oniguruma question — Ralf Junker <ralfjunker@...>
I see that the Ruby source code contains modified and more recent version of the Oniguruma regular expression library.
[#23305] [Bug #1403] Process.daemon should do a double fork to avoid problems with controlling terminals — Gary Wright <redmine@...>
Bug #1403: Process.daemon should do a double fork to avoid problems with controlling terminals
Hi,
[#23311] [Bug #1404] Net::HTTP::Post failing when a post field contains ":" — Ignacio Martín <redmine@...>
Bug #1404: Net::HTTP::Post failing when a post field contains ":"
[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>
Feature #1408: 0.1.to_r not equal to (1/10)
Issue #1408 has been updated by tadayoshi funaba.
Hi,
Hi.
Issue #1408 has been updated by Marc-Andre Lafortune.
Issue #1408 has been updated by Roger Pack.
[#23321] [Bug #1412] 1.8.7-p160 extmk.rb fails when cross compiling — Luis Lavena <redmine@...>
Bug #1412: 1.8.7-p160 extmk.rb fails when cross compiling
[ruby-core:23204] Re: Regexp Encoding
James Gray wrote:
> On Apr 13, 2009, at 6:12 PM, NARUSE, Yui wrote:
>
>> And these are set Regexp::FIXEDENCODING.
>> This raise exceptions on strings with other encodings
>> even if the regexp contains only 7-bit.
>> The constant Regexp::FIXEDENCODING is defined in 1.9.2
>> but the value is also used in 1.9.1.
>
> I'm sorry, but I don't think I understood this. I tried to check it in
> irb, but that confused me even more:
>
> $ irb_dev
> irb(main):001:0> Regexp::FIXEDENCODING
> => 16
>
> Can you explain what the magic 16 means here please?
irb(main):005:0> Regexp::IGNORECASE
=> 1
irb(main):006:0> Regexp::EXTENDED
=> 2
irb(main):007:0> Regexp::MULTILINE
=> 4
irb(main):008:0> Regexp::FIXEDENCODING
=> 16
Regexp::FIXEDENCODING is a constant for specifying regexp option, like Regexp::IGNORECASE, Regexp::EXTENDED and Regexp::MULTILINE. So magic 16 has no special meanings. This means only the value which is same as ARG_ENCODING_FIXED (in re.c). This value may differ on other implementations.
>>> * A / literal that would be US-ASCII due to the source Encoding or
>>> /n will be upgraded to ASCII-8BIT by hex, octal, control, meta, or
>>> control-meta byte escapes (as discussed in [ruby-core:23184])
>> simillar to above, /n raise warnings on other than ASCII-8BIT strings.
>
> I'm not sure I understand. What wouldn't be valid in ASCII-8BIT?
See following difference,
irb(main):016:0> /a/n =~ "a\u3042"
(irb):16: warning: regexp match /.../n against to UTF-8 string
=> 0
irb(main):017:0> Regexp.new("a".force_encoding("ASCII-8BIT")) =~ "a\u3042"
=> 0
This means /n set a flag to regexp. This flag is internally called as ARG_ENCODING_NONE and its value is 32 (in re.c). This is same logic of ARG_ENCODING_FIXED.
Why /n sets ARG_ENCODING_NONE and doesn't raise Exception but warnings is, the usage of /n was more ambigous than /u, /s and /e.
This value wasn't provided as Ruby's constant yet.
>>> * A / literal will receive a UTF-8 Encoding if it includes \u escapes
>>> * Regexp objects constructed with Regexp::new() receive the Encoding
>>> of the String passed containing the regular expression
>>> Am I right so far? Am I missing any variations?
>>> Am I right that Regexp's favor US-ASCII because it maximizes their
>>> compatibility? It makes it so you can use them on any ASCII
>>> compatible String instead of just a String in the source Encoding,
>>> right?
>>
>> Yes, and if you set Regexp::FIXEDENCODING the regexp will match only the
>> same encoding.
>
> Again, I'm not sure how I set this.
As you set Regexp::IGNORECASE,
irb(main):077:0> Regexp.new("a".force_encoding("iso-8859-1"))=~"a\u3042"
=> 0
irb(main):078:0> Regexp.new("a".force_encoding("iso-8859-1"),Regexp::FIXEDENCODING)=~"a\u3042"
Encoding::CompatibilityError: incompatible encoding regexp match (ISO-8859-1 regexp with UTF-8 string)
from (irb):78:in `=~'
from (irb):78
from /usr/local/bin/irb19:12:in `<main>'
--
NARUSE, Yui <naruse@airemix.jp>