1. Perl
  2. Module
  3. here

Encode::UTF8Mac - Mac OS X filename encoding

I think Mac OS X uses UTF-8 as the file system encoding, but it's actually a little different, and it's a Mac OX X-specific specification. To handle this correctly, it is easy to use a module called Encode::UTF8Mac.

use Encode qw/encode decode/;
use Encode::UTF8Mac;

# Encode
my $byte = encode('utf-8-mac', $string);

# Decode
my $string = decode('utf-8-mac', $byte);

If you use use to load Encode::UTF8Mac, you will be able to use utf-8-mac as the encoding for your Encode module. This encoding allows Mac OS X filenames to be handled correctly.

The Encode::UTF8Mac method is recommended because it allows you to use standard Encode modules without using Mac OS X-specific methods such as Text::Iconv.

Related Informatrion