chromatic > Mojolicious-Plugin-UnicodeNormalize-1.20140306 > Mojolicious::Plugin::UnicodeNormalize

Download:
Mojolicious-Plugin-UnicodeNormalize-1.20140306.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.20140306   Source  

NAME ^

Mojolicious::Plugin::UnicodeNormalize - normalize incoming Unicode parameters

SYNOPSIS ^

    # Mojolicious
    sub startup {
        my $self = shift;
        $self->plugin( 'UnicodeNormalize' );

        ...
    }

    # Mojolicious::Lite
    plugin 'UnicodeNormalize';

    ...

DESCRIPTION ^

Mojolicious::Plugin::UnicodeNormalize allows you to normalize all incoming Unicode parameters to a single normalization form. (For more information on why Unicode normalization is important, see Tom Christiansen's Unicode cookbook, especially http://www.perl.com/pub/2012/05/perlunicookbook-unicode-normalization.html.)

This plugin sets up a normalization hook to run before Mojolicious dispatch. It will normalize all non-reference parameters. By default, this uses Unicode Normalization Form C, which is almost always what you want. You may specify another form when you register the plugin:

    # Mojolicious
    sub startup {
        my $self = shift;
        $self->plugin( 'UnicodeNormalize', { form => 'NFD' } );

        ...
    }

Any normalization form supported by Unicode::Normalize is valid; currently this list is:

Unless you know why you might use an alternate form, use the default of NFC.

AUTHOR ^

chromatic <chromatic@cpan.org>, sponsored by Golden Guru (http://goldenguru.com/).

SEE ALSO ^

Mojolicious, Unicode::Normalize

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License, version 2 (the same terms as Perl itself).

syntax highlighting: