ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/XS.pm
(Generate patch)

Comparing CBOR-XS/XS.pm (file contents):
Revision 1.32 by root, Sat Nov 30 18:42:27 2013 UTC vs.
Revision 1.33 by root, Sun Dec 1 14:30:52 2013 UTC

241If C<$enable> is false (the default), then C<encode> will encode strings 241If C<$enable> is false (the default), then C<encode> will encode strings
242the standard CBOR way. 242the standard CBOR way.
243 243
244This option does not affect C<decode> in any way - string references will 244This option does not affect C<decode> in any way - string references will
245always be decoded properly if present. 245always be decoded properly if present.
246
247=item $cbor = $cbor->validate_utf8 ([$enable])
248
249=item $enabled = $cbor->get_validate_utf8
250
251If C<$enable> is true (or missing), then C<decode> will validate that
252elements (text strings) containing UTF-8 data in fact contain valid UTF-8
253data (instead of blindly accepting it). This validation obviously takes
254extra time during decoding.
255
256The concept of "valid UTF-8" used is perl's concept, which is a superset
257of the official UTF-8.
258
259If C<$enable> is false (the default), then C<decode> will blindly accept
260UTF-8 data, marking them as valid UTF-8 in the resulting data structure
261regardless of whether thats true or not.
262
263Perl isn't too happy about corrupted UTF-8 in strings, but should
264generally not crash or do similarly evil things. Extensions might be not
265so forgiving, so it's recommended to turn on this setting if you receive
266untrusted CBOR.
267
268This option does not affect C<encode> in any way - strings that are
269supposedly valid UTF-8 will simply be dumped into the resulting CBOR
270string without checking whether that is, in fact, true or not.
246 271
247=item $cbor = $cbor->filter ([$cb->($tag, $value)]) 272=item $cbor = $cbor->filter ([$cb->($tag, $value)])
248 273
249=item $cb_or_undef = $cbor->get_filter 274=item $cb_or_undef = $cbor->get_filter
250 275

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines