|
|
1 | =head1 NAME |
|
|
2 | |
1 | =encoding utf-8 |
3 | =encoding utf-8 |
2 | |
|
|
3 | =head1 NAME |
|
|
4 | |
4 | |
5 | JSON::XS - JSON serialising/deserialising, done correctly and fast |
5 | JSON::XS - JSON serialising/deserialising, done correctly and fast |
6 | |
6 | |
7 | JSON::XS - 正しくて高速な JSON シリアライザ/デシリアライザ |
7 | JSON::XS - 正しくて高速な JSON シリアライザ/デシリアライザ |
8 | (http://fleur.hio.jp/perldoc/mix/lib/JSON/XS.html) |
8 | (http://fleur.hio.jp/perldoc/mix/lib/JSON/XS.html) |
… | |
… | |
825 | my $x = "3"; # some variable containing a string |
825 | my $x = "3"; # some variable containing a string |
826 | $x += 0; # numify it, ensuring it will be dumped as a number |
826 | $x += 0; # numify it, ensuring it will be dumped as a number |
827 | $x *= 1; # same thing, the choice is yours. |
827 | $x *= 1; # same thing, the choice is yours. |
828 | |
828 | |
829 | You can not currently force the type in other, less obscure, ways. Tell me |
829 | You can not currently force the type in other, less obscure, ways. Tell me |
830 | if you need this capability (but don't forget to explain why its needed |
830 | if you need this capability (but don't forget to explain why it's needed |
831 | :). |
831 | :). |
832 | |
832 | |
833 | =back |
833 | =back |
834 | |
834 | |
835 | |
835 | |
… | |
… | |
837 | |
837 | |
838 | The interested reader might have seen a number of flags that signify |
838 | The interested reader might have seen a number of flags that signify |
839 | encodings or codesets - C<utf8>, C<latin1> and C<ascii>. There seems to be |
839 | encodings or codesets - C<utf8>, C<latin1> and C<ascii>. There seems to be |
840 | some confusion on what these do, so here is a short comparison: |
840 | some confusion on what these do, so here is a short comparison: |
841 | |
841 | |
842 | C<utf8> controls wether the JSON text created by C<encode> (and expected |
842 | C<utf8> controls whether the JSON text created by C<encode> (and expected |
843 | by C<decode>) is UTF-8 encoded or not, while C<latin1> and C<ascii> only |
843 | by C<decode>) is UTF-8 encoded or not, while C<latin1> and C<ascii> only |
844 | control wether C<encode> escapes character values outside their respective |
844 | control whether C<encode> escapes character values outside their respective |
845 | codeset range. Neither of these flags conflict with each other, although |
845 | codeset range. Neither of these flags conflict with each other, although |
846 | some combinations make less sense than others. |
846 | some combinations make less sense than others. |
847 | |
847 | |
848 | Care has been taken to make all flags symmetrical with respect to |
848 | Care has been taken to make all flags symmetrical with respect to |
849 | C<encode> and C<decode>, that is, texts encoded with any combination of |
849 | C<encode> and C<decode>, that is, texts encoded with any combination of |
… | |
… | |
1193 | =head1 THREADS |
1193 | =head1 THREADS |
1194 | |
1194 | |
1195 | This module is I<not> guaranteed to be thread safe and there are no |
1195 | This module is I<not> guaranteed to be thread safe and there are no |
1196 | plans to change this until Perl gets thread support (as opposed to the |
1196 | plans to change this until Perl gets thread support (as opposed to the |
1197 | horribly slow so-called "threads" which are simply slow and bloated |
1197 | horribly slow so-called "threads" which are simply slow and bloated |
1198 | process simulations - use fork, its I<much> faster, cheaper, better). |
1198 | process simulations - use fork, it's I<much> faster, cheaper, better). |
1199 | |
1199 | |
1200 | (It might actually work, but you have been warned). |
1200 | (It might actually work, but you have been warned). |
1201 | |
1201 | |
1202 | |
1202 | |
1203 | =head1 BUGS |
1203 | =head1 BUGS |
1204 | |
1204 | |
1205 | While the goal of this module is to be correct, that unfortunately does |
1205 | While the goal of this module is to be correct, that unfortunately does |
1206 | not mean its bug-free, only that I think its design is bug-free. It is |
1206 | not mean it's bug-free, only that I think its design is bug-free. It is |
1207 | still relatively early in its development. If you keep reporting bugs they |
1207 | still relatively early in its development. If you keep reporting bugs they |
1208 | will be fixed swiftly, though. |
1208 | will be fixed swiftly, though. |
1209 | |
1209 | |
1210 | Please refrain from using rt.cpan.org or any other bug reporting |
1210 | Please refrain from using rt.cpan.org or any other bug reporting |
1211 | service. I put the contact address into my modules for a reason. |
1211 | service. I put the contact address into my modules for a reason. |