File: convert_errors.patch

package info (click to toggle)
libxml-sax-writer-perl 0.50-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 144 kB
  • ctags: 66
  • sloc: perl: 494; makefile: 42
file content (19 lines) | stat: -rw-r--r-- 694 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Author: Florian Ragwitz <rafl@debian.org>
Description: add more documentation on encoding errors
--- libxml-sax-writer-perl.orig/Writer.pm
+++ libxml-sax-writer-perl/Writer.pm
@@ -580,6 +580,14 @@
 
 =back
 
+Note that the return value of the convert method is B<not> checked. Output may
+be truncated if a character couldn't be converted correctly. To avoid problems
+the encoder should take care encoding errors itself, for example by raising an
+exception. If you use Text::Iconv as the encoder you can use the following:
+
+  my $w = XML::Sax::Writer->new;
+  $w->{Encoder}->raise_error(1);
+
 =head1 CUSTOM OUTPUT
 
 This module is generally used to write XML -- which it does most of the