From: Michael Selig Date: 2009-02-05T08:06:55+09:00 Subject: [ruby-core:21840] [Feature #1106] Script encoding vs. default_internal: Implicitly transcode strings/regexps Issue #1106 has been updated by Michael Selig. There were a number of quite long discussions about String (and Regexp) literal encodings (as well as other encoding compatibility issues) last year. The decisions (as I recall) were: - There should be NO silent transcoding in Ruby. This includes literals, and also when operating on strings with different encodings. The rationale was that transcoding was not always available, and was not always safe. - If a program uses "default_internal" (which is likely to be UTF-8 in most circumstances) it is up to the programmer to make sure that string literals are in the default_internal encoding. This usually means that all the source file encodings need to be in the default_internal encoding (or are ASCII). - Libraries being called by programs which may or may not use default_internal need to be careful about their use of String literals. ASCII literals are safe as long as both the source & default_internal encodings are both ASCII compatible (ruling out say UTF-16 and UTF-32). There was a discussion about whether default_internal and soure file encoding should be forced to be ASCII compatible. I am not sure what the outcome was. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1106 ---------------------------------------- http://redmine.ruby-lang.org