[#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!

8 messages 2009/04/17

[#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)

19 messages 2009/04/26

[ruby-core:23193] Regexp Encoding

From: James Gray <james@...>
Date: 2009-04-13 13:52:25 UTC
List: ruby-core #23193
I'm trying to document the Encoding Regexp objects receive for the  
m17n series on my blog.  This is how I think it works:

* A / literal is given a US-ASCII Encoding if it contains only 7-bit  
characters
* A / literal receives the current source Encoding when it contains  
8-bit characters
* The old /u and /n style modifiers still work to force a UTF-8 or US- 
ASCII Encoding
* 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])
* 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?

Thanks again for the help.

James Edward Gray II


In This Thread

Prev Next