NAME

PerlIO::fse - Deals with Filesystem Encoding

SYNOPSIS

# for Windows (including Cygwin)
open my $io,  '<:fse', $filename;

# Other systems
$ENV{PERLIO_FSE} = $encoding; # UTF-8 is default
# or
use PerlIO::fse $encoding;

open my $io, '<:fse', $filename;

DESCRIPTION

PerlIO::fse mediates encodings between Perl and Filesystem. It converts filenames into native forms if the filenames are utf8-flagged. Otherwise, PerlIO::fse does nothing, looking on it as native forms.

PerlIO::fse attempts to get the filesystem encoding(fse) from $ENV{PERLIO_FSE}, and if defined, it will be used. Or you can use PerlIO::fse $encoding directive to set fse.

If you use Windows (or Cygwin), you need not to set $ENV{PERLIO_FSE} because the current codepage is detected automatically. However, if $ENV{PERLIO_FSE} is set, PerlIO::fse will give it priority.

When there is no encoding available, UTF-8 will be used.

This layer uses Encode internally to convert encodings.

SEE ALSO

PerlIO::Util.

Encode.

AUTHOR

Goro Fuji (藤 吾郎) <gfuji (at) cpan.org>

LICENSE AND COPYRIGHT

Copyright (c) 2008, Goro Fuji <gfuji (at) cpan.org>. Some rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.