I'm not sure why UTF8-MAC was introduced. UTF8-MAC indeed
isn't supported currently for transcoding.

I don't even know what UTF8-MAC is. It is defined as a replica
of UTF-8 in enc/utf_8.c. It is not defined at
http://www.iana.org/assignments/character-sets.

It may be that it is an attempt to refer to the fact that UTF-8
usually is used in decomposed form (NFD) on the Mac. But that
would not be relevant for opening a file, because the Mac OS
accepts any kind of normalization, and converts to NFD by itself
(similar to a file system that accepts both upper- and lower-case,
but internally uses only one case).

Also, the issues of normalization is orthogonal to what kind of
encoding form is used for Unicode, and therefore adding it to
an encoding is something that we should consider much more
carefully. Overall, UTF-8 should be UTF-8, it's a bad idea to
create variants.

Regards,   Martin.


At 09:42 08/06/18, Eric Hodel wrote:
>Issue #178 has been reported by Eric Hodel.
>
>----------------------------------------
>Bug #178: File.open on sprintf-formatted string fails with encoding 
>conversion error on OS X
>http://redmine.ruby-lang.org/issues/show/178
>
>Author: Eric Hodel
>Status: Open
>Priority: Normal
>Assigned to: 
>Category: 
>Target version: 
>
>
>String#% and File.open are interacting strangely on OS X, so files opened 
>with a sprintf formatted string raise an ArgumentError:
>
>$ ruby19 -vwe 'File.new("foo" % [])'
>ruby 1.9.0 (2008-06-18 revision 15873) [i686-darwin9.3.0]
>-e:1:in `initialize': transcoding not supported (from US-ASCII to UTF8-MAC) 
>(ArgumentError)
>       from -e:1:in `new'
>       from -e:1:in `<main>'
>
>Using just "foo" as the filename works fine:
>
>$ ruby19 -we 'File.new("foo")'
>
>As does String#<<:
>
>$ ruby19 -we 'File.new("foo" << "")'
>
>
>----------------------------------------
>You have received this notification because you have either subscribed to 
>it, or are involved in it.
>To change your notification preferences, please click here: 
>http://redmine.ruby-lang.org/my/account


#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp       mailto:duerst / it.aoyama.ac.jp