From: David Flanagan Date: 2007-09-29T13:39:47+09:00 Subject: String.force_encoding Hi, Nobu has just checked in a String.force_encoding method, which alters the encoding of a string (without, apparently modifying the underlying bytes at all: that is, it does not transcode from Unicode to SJIS or anything; it just changes the interpretation of the underlying bytes.) 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. I don't want to re-open a discussion if this decision has already been firmly made. I can live with force_encoding; it is not likely to be used often. But I do want to suggest that it is awkward in English and I think we can do better. My primary complaint is that "force" has connotations of "something you shouldn't do". Putting "force" in a method name seems to me to be an inelegant substitute for ending the name with ! The only parts of the ruby-dev thread I can understand were some of the other names considered. One I liked was short and sweet: "as". But for longer names, I think that either "set_encoding" or "alter_encoding" sound better than "force_encoding" and don't imply transcoding in the way that "encode" does. Also, one more request: can we make force_encoding accept nil as a way to specify ASCII (aka binary) encoding? David