summaryrefslogtreecommitdiffstats
path: root/qooxdoo/source/perl/JSON/PP5005.pm
blob: c7000b16c88f41f1c93607fc83ef09d0c8d4d78a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package JSON::PP5005;

use 5.005;
use strict;

my @properties;

$JSON::PP5005::VERSION = '0.05';

BEGIN {
    *JSON::PP::JSON_encode_ascii   = *_encode_ascii;
    *JSON::PP::JSON_encode_latin1  = *_encode_latin1;
    *JSON::PP::JSON_decode_unicode = *_disable_decode_unicode;

    sub utf8::is_utf8 {
        1; # It is considered that UTF8 flag on for Perl 5.005.
    }

    sub utf8::encode (\$) {
    }

    sub utf8::decode (\$) {
    }

    sub JSON::PP::ascii {
        warn "ascii() is disable in Perl5.005.";
        $_[0]->{ascii} = 0; $_[0];
    }

    sub JSON::PP::latin1 {
        warn "latin1() is disable in Perl5.005.";
        $_[0]->{latin1} = 0; $_[0];
    }

    # missing in B module.
    sub B::SVf_IOK () { 0x00010000; }
    sub B::SVf_NOK () { 0x00020000; }

}


sub _encode_ascii {
    # currently noop
}


sub _encode_latin1 {
    # currently noop
}


sub _disable_decode_unicode { chr(hex($_[0])); }



1;
__END__

=pod

=head1 NAME

JSON::PP5005 - Helper module in using JSON::PP in Perl 5.005

=head1 DESCRIPTION

JSON::PP calls internally.

=head1 AUTHOR

Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>


=head1 COPYRIGHT AND LICENSE

Copyright 2007 by Makamaka Hannyaharamitu

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

=cut