From: Yukihiro Matsumoto Date: 2007-09-29T14:34:16+09:00 Subject: Re: String.force_encoding Hi, In message "Re: String.force_encoding" on Sat, 29 Sep 2007 13:39:47 +0900, David Flanagan writes: |In the changelog, Martin Duerst is credited with suggesting the name |force_encoding. Could Martin or Nobu or Matz explain to non-Japanese |speakers the thinking behind this name. The last I heard it was going |to be called "encode". I can see that the name "encode" has hints of |transcoding, and a user might think that it did more than it actually does. The original #encode was supposed to do * code conversion * encoding validation * encoding tag addition It's OK for most of the cases, but if one wants to just change an encoding tag of a string, it's overkill. That's the reason we prepare #force_encoding method. It has a longer name since it's not for common use. #encode will remain. |Also, one more request: can we make force_encoding accept nil as a way |to specify ASCII (aka binary) encoding? Any reason for force_encoding(nil) instead of force_encoding("binary")? matz.