From: Michael Selig Date: 2008-10-02T11:44:23+09:00 Subject: [ruby-core:19099] Re: Encodings::default_internal patch ----- Original Message ----- From: "Vincent Isambart" To: Sent: Thursday, October 02, 2008 12:26 PM Subject: [ruby-core:19097] Re: Encodings::default_internal patch > Hi, > >> The only problem I see with allowing default_internal to be unset is in >> libraries. > You can just prevent the code from setting more than once. Sorry, I meant the case when default_internal is *never* set. The problem I was trying to highlight is when multiple strings/regexps/files are passed to a library, whether the library is expected to check that all the encodings are compatible, and with outputs, what encoding they should pass back. If "default_internal" is always set, then a library's inputs are very likely to be compatible, so there is probably no need for them to check, plus the library can always set the encodings of strings etc passed back to the caller. >> What encoding should they expect in their parameters? Can they at >> least expect it to be ASCII-compatible? > Well I do not know if we will be able to set default_internal to a > non-ASCII-compatible encoding but I think most libraries do not need > to care about such encodings. The (probably very few) people who use > those encodings should not be astonished if a library does not work > with such an encoding. Yes, I agree that default_internal should always be an ASCII-compatible encoding. Otherwise ASCII string/regexp literals can easily break. Please see [ruby-core:19013] point (b). Cheers Mike