~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to pod/chooseDirectory.pod

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
=back
58
58
 
 
59
=head1 CAVEATS
 
60
 
 
61
Perl does not have a concept of encoded filesystems yet. This means
 
62
that operations on filenames like C<opendir> and C<open> still use
 
63
byte semantics. Tk however uses character semantics internally, which
 
64
means that you can get filenames with the UTF-8 flag set in functions
 
65
like C<chooseDirectory>, C<getOpenFile> and similar. It's the user's
 
66
responsibility to determine the encoding of the underlying filesystem
 
67
and convert the result into bytes, e.g.
 
68
 
 
69
    use Encode;
 
70
    ...
 
71
    my $dir = $mw->chooseDirectory;
 
72
    $dir = encode("windows-1252", $dir);
 
73
    opendir DIR, $dir or die $!;
 
74
    ...
 
75
 
 
76
See also L<perlunicode/When Unicode Does Not Happen> and
 
77
L<perltodo/Unicode in Filenames>.
 
78
 
59
79
=head1 SEE ALSO
60
80
 
61
81
L<Tk::getOpenFile>, L<Tk::getOpenFile>