=head1 NAME SuikaWiki::DB::FileSystem::Pescaped - "PLUS SIGN escaped" Filename Submodule =head1 SYNOPSIS package SomeWikiDB; require SuikaWiki::DB::FileSystem::Pescaped; push our @ISA, qw(SuikaWiki::DB::FileSystem::Pescaped SuikaWiki::DB::FileSystem::Base); ...WikiDB implementation... =head1 DESCRIPTION C provides directory- and file-escaping internal-methods, which escape alphanumerics ([0-9A-Za-z_-]) in ASCII and others in base 16 prefixed by PLUS SIGN (+). This module is intended to be used as one of superclass for WikiDB implementing class that extends C. This module is part of SuikaWiki. =cut package SuikaWiki::DB::FileSystem::Pescaped; use strict; our $VERSION=do{my @r=(q$Revision: 1.1 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; sub __encode_base16 ($$) { my (undef, $s) = @_; ## TODO: utf8 support $s =~ s/([^A-Za-z0-9_-])/sprintf '+%02X', ord $1/ges; $s; } sub __decode_base16 ($$) { my (undef, $s) = @_; $s =~ s/\+([0-9A-Fa-f][0-9A-Fa-f])/pack 'C', hex $1/ge; ## TODO: utf8 support $s; } =head1 EXAMPLE See C. =head1 LICENSE Copyright 2004 Wakaba . All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; # $Date: 2004/06/03 06:38:48 $