Issue #4489 has been updated by Yui NARUSE. James M. Lawrence wrote: > Notice the patch corrects a typo (5 instead of 4) which has been there since 2007. > Ruby *accidentally* recognizes utf-8-mac as UTF8-MAC encoding because of the typo. > That accident is, fortunately, correct behavior. > > However you think it should work, the code below the typo is not being executed. > > - if (len > 4 && name[nlen = len - 5] == '-') { > + if (len > 4 && name[nlen = len - 4] == '-') { I fixed it at r31085, thank you for reporting. ---------------------------------------- Bug #4489: [PATCH] Encodings with /-(unix|dos|mac)\Z/ http://redmine.ruby-lang.org/issues/4489 Author: James M. Lawrence Status: Rejected Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3dev (2011-03-10 trunk 31080) [i386-darwin9.8.0] The *-dos and *-mac meta-encodings were not being recognized. utf-8-mac is a special case since it corresponds to a real encoding; its meta-encoding is utf-8-mac-mac. -- http://redmine.ruby-lang.org