Data::FormValidator::Filters::Demoroniser - A Data::FormValidator filter that allows you to demoronise a string.


Data-FormValidator-Filters-Demoroniser documentation Contained in the Data-FormValidator-Filters-Demoroniser distribution.

Index


Code Index:

NAME

Top

Data::FormValidator::Filters::Demoroniser - A Data::FormValidator filter that allows you to demoronise a string.

SYNOPSIS

Top

   use Data::FormValidator::Filters::Demoroniser qw(demoroniser);

   # Data::FormValidator Profile:
   my $dfv_profile = {
      required => [ qw/foo bar/ ],
      field_filters => {
         foo => [ 'trim', demoroniser() ]
      }
   };

DESCRIPTION

Top

Data::FormValidator filter that allows you to demoronise a string in form field values.

API

Top

This module exports the following filters:

demoroniser

Given a string, will replace the Microsoft "smart" characters with sensible ACSII versions.

demoroniser_utf8

The same as demoroniser, but converts into correct UTF8 versions.

NOTES

Top

Although Data-FormValidator is not a dependency, it is expected that this module will be used as part of DFV's constraint framework.

This module was originally written as part of the Labyrinth website management tool.

SEE ALSO

Top

Data::FormValidator, Text::Demoroniser

THANK YOU

Top

This module was written after Smylers spotted a problem in submitting a survey for the YAPC::Europe 2009 Perl Conference. Unfortunately the forms were not accepting the Microsoft "smart" characters and causing problems when submitting the form. So a big thanks to Smylers for inspiring this module.

Also thanks to Brian Cassidy for further suggestions for improvements.

AUTHOR

Top

Barbie, <barbie@missbarbell.co.uk>

COPYRIGHT AND LICENSE

Top


Data-FormValidator-Filters-Demoroniser documentation Contained in the Data-FormValidator-Filters-Demoroniser distribution.

package Data::FormValidator::Filters::Demoroniser;

use strict;
use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS );
use Text::Demoroniser;

BEGIN {
	require Exporter;
	$VERSION = '0.02';
	@ISA = qw( Exporter );
	@EXPORT = qw();
	%EXPORT_TAGS = (
		'all' => [ qw( demoroniser demoroniser_utf8 ) ]
	);
	@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
}

sub demoroniser {
	return sub { return Text::Demoroniser::demoroniser( shift ) };
}

sub demoroniser_utf8 {
	return sub { return Text::Demoroniser::demoroniser_utf8( shift ) };
}

1;
__END__