Dancer2::Plugin::UnicodeNormalize - Normalize incoming Unicode parameters
Version 0.03
use Dancer2::Plugin::UnicodeNormalize;
Dancer2::Plugin::UnicodeNormalize normalizes all incoming parameters to a given normalization form. This is achieved with a before hook, which should run silently before processing each route. By default, we use Unicode Normalization Form C - this is usually what you want. Other forms can be selected, see: "CONFIGURATION".
This plugin was inspired by Mojolicious::Plugin::UnicodeNormalize. For information on why Unicode Normalization is important, please see:
http://www.perl.com/pub/2012/05/perlunicookbook-unicode-normalization.html
http://www.modernperlbooks.com/mt/2013/11/mojolicious-unicode-normalization-plugin-released.html
plugins:
UnicodeNormalize:
form: NFC
exclude:
- '^/(css|javascripts|images)'
The form
parameter is described in Unicode::Normalize. Default is NFC.
The exclude
parameter consists of a list of regular expressions to match routes we do not wish to process parameters for.
John Barrett, <[email protected]>
http://github.com/jbarrett/Dancer2-Plugin-UnicodeNormalize
All comments and contributions welcome.
Please direct all requests to http://github.com/jbarrett/Dancer2-Plugin-UnicodeNormalize/issues or email <[email protected]>.
Copyright 2013 John Barrett.
This application is free software; you can redistribute it and/or modify it under the same terms as Perl itself.