GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Unicode::RecursiveDowngrade(3) User Contributed Perl Documentation Unicode::RecursiveDowngrade(3)

Unicode::RecursiveDowngrade - Turn off the UTF-8 flags inside of complex variable

 use Unicode::RecursiveDowngrade;
 
 $rd = Unicode::RecursiveDowngrade->new;
 $var = {
     foo   => 'bar',
     baz   => [
         'qux',
         'quux',
     ],
     corge => \$grault,
 };
 $unflagged = $rd->downgrade($var);

Unicode::RecursiveDowngrade will turn off the UTF-8 flag inside of complex variable in a lump. In spite of your intention, some modules turn it on every elements of returned variable. You may be hard up for turn them off if you don't need any UTF-8 flags in your variable. This module will fix it up easily.

Sometime I think about the UTF-8 flag is not stead. But some "XML::Parser" based modules will turn it on. For example, "XML::Simple" is really simple way to parse XMLs, but this module returns a simple hashref including flagged values. This hashref is very hard to use, isn't it?

  • new

    "new()" is a constructor method.

  • filter

    You can set some filter to "filter()" accessor. The values of downgraded will be passed this filter function. You have to set a code reference to this accessor. Like this:

     use Unicode::RecursiveDowngrade;
     use Unicode::Japanese;
     
     $rd = Unicode::RecursiveDowngrade->new;
     $rd->filter(sub { Unicode::Japanese->new(shift, 'utf8')->euc });
     $unflagged = $rd->downgrade($var);
        

    the passed subref will be called inside "downgrade()" method.

  • downgrade

    "downgrade()" returns a turned off variable of argument.

$Unicode::RecursiveDowngrade::DowngradeFunc

This variable has a downgrade function for "downgrade()" method. You can override the variable for some other way.

Koichi Taniguchi <taniguchi@livedoor.jp>

Copyright (c) 2005 Koichi Taniguchi. Japan. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

utf8
2008-03-06 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.