r61721 - in /trunk/libxml-sax-writer-perl: debian/patches/convert_errors.patch debian/patches/quote_xml_version.patch lib/XML/SAX/Writer.pm lib/XML/SAX/Writer/XML.pm
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Thu Aug 19 08:26:05 UTC 2010
Author: periapt-guest
Date: Thu Aug 19 08:25:00 2010
New Revision: 61721
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=61721
Log:
Forwarded bug report to RT
Modified:
trunk/libxml-sax-writer-perl/debian/patches/convert_errors.patch
trunk/libxml-sax-writer-perl/debian/patches/quote_xml_version.patch
trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm
trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm
Modified: trunk/libxml-sax-writer-perl/debian/patches/convert_errors.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-sax-writer-perl/debian/patches/convert_errors.patch?rev=61721&op=diff
==============================================================================
--- trunk/libxml-sax-writer-perl/debian/patches/convert_errors.patch (original)
+++ trunk/libxml-sax-writer-perl/debian/patches/convert_errors.patch Thu Aug 19 08:25:00 2010
@@ -1,20 +1,78 @@
+Subject: Fix documentation issues
+ * add more documentation on encoding errors
+ * Implementation moved from Text::Iconv to Encode without updating
+ documentation. Also the change broke Florian's suggestion.
+ * Stripped a number of stray characters of dubious encoding.
+ These appear to be blank in the code, appear as 'A' in the man page,
+ and 'A^' in the CPAN web page.
Author: Florian Ragwitz <rafl at debian.org>
-Description: add more documentation on encoding errors
-Index: libxml-sax-writer-perl/lib/XML/SAX/Writer.pm
-===================================================================
---- libxml-sax-writer-perl.orig/lib/XML/SAX/Writer.pm 2009-02-25 23:00:41.000000000 +0000
-+++ libxml-sax-writer-perl/lib/XML/SAX/Writer.pm 2009-02-25 23:01:46.000000000 +0000
-@@ -588,6 +588,14 @@
+Last-Update: 2010-08-19
+Bug: http://rt.cpan.org/Ticket/Display.html?id=60504
+Reviewed-By: Nicholas Bamber <nicholas at periapt.co.uk>
+--- a/lib/XML/SAX/Writer.pm
++++ b/lib/XML/SAX/Writer.pm
+@@ -437,16 +437,16 @@
+
+ =item * new(%hash)
+
+-This is the constructor for this object. Â It takes a number of
++This is the constructor for this object. It takes a number of
+ parameters, all of which are optional.
+
+ =item -- Output
+
+-This parameter can be one of several things. Â If it is a simple
++This parameter can be one of several things. If it is a simple
+ scalar, it is interpreted as a filename which will be opened for
+-writing. Â If it is a scalar reference, output will be appended to this
+-scalar. Â If it is an array reference, output will be pushed onto this
+-array as it is generated. Â If it is a filehandle, then output will be
++writing. If it is a scalar reference, output will be appended to this
++scalar. If it is an array reference, output will be pushed onto this
++array as it is generated. If it is a filehandle, then output will be
+ sent to this filehandle.
+
+ Finally, it is possible to pass an object for this parameter, in which
+@@ -460,7 +460,7 @@
+
+ This should be a hash reference where the keys are characters
+ sequences that should be escaped and the values are the escaped form
+-of the sequence. Â By default, this module will escape the ampersand
++of the sequence. By default, this module will escape the ampersand
+ (&), less than (<), greater than (>), double quote ("), and apostrophe
+ ('). Note that some browsers don't support the ' escape used for
+ apostrophes so that you should be careful when outputting XHTML.
+@@ -482,7 +482,7 @@
+
+ =item -- EncodeTo
+
+-The character set encoding in which output should be encoded. Â Again,
++The character set encoding in which output should be encoded. Again,
+ this defaults to UTF-8.
+
+ =item -- QuoteCharacter
+@@ -588,10 +588,9 @@
+ =head1 THE ENCODER INTERFACE
+
+ Encoders can be plugged in to allow one to use one's favourite encoder
+-object. Presently there are two encoders: Iconv and NullEncoder, and
+-one based on C<Encode> ought to be out soon. They need to implement
+-two methods, and may inherit from XML::SAX::Writer::NullConverter if
+-they wish to
++object. Presently there are two encoders: Encode and NullEncoder. They
++need to implement two methods, and may inherit from
++XML::SAX::Writer::NullConverter if they wish to
+
+ =over 4
+
+@@ -605,6 +604,11 @@
=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);
++exception.
+
=head1 CUSTOM OUTPUT
Modified: trunk/libxml-sax-writer-perl/debian/patches/quote_xml_version.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-sax-writer-perl/debian/patches/quote_xml_version.patch?rev=61721&op=diff
==============================================================================
--- trunk/libxml-sax-writer-perl/debian/patches/quote_xml_version.patch (original)
+++ trunk/libxml-sax-writer-perl/debian/patches/quote_xml_version.patch Thu Aug 19 08:25:00 2010
@@ -1,8 +1,11 @@
+Subject: use double quotes in xml declarations
Author: Florian Ragwitz <rafl at debian.org>
-Description: use double quotes in xml declarations
+Reviewed-by: Nicholas Bamber <nicholas at periapt.co.uk>
+Forwarded: no
+Last-Update: 2010-08-17
--- a/lib/XML/SAX/Writer/XML.pm
+++ b/lib/XML/SAX/Writer/XML.pm
-@@ -481,14 +481,14 @@ sub xml_decl {
+@@ -481,14 +481,14 @@
# also, there's order in the pseudo-attr
my $xd = '';
if ($data->{Version}) {
Modified: trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm?rev=61721&op=diff
==============================================================================
--- trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm (original)
+++ trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm Thu Aug 19 08:25:00 2010
@@ -437,16 +437,16 @@
=item * new(%hash)
-This is the constructor for this object. Â It takes a number of
+This is the constructor for this object. It takes a number of
parameters, all of which are optional.
=item -- Output
-This parameter can be one of several things. Â If it is a simple
+This parameter can be one of several things. If it is a simple
scalar, it is interpreted as a filename which will be opened for
-writing. Â If it is a scalar reference, output will be appended to this
-scalar. Â If it is an array reference, output will be pushed onto this
-array as it is generated. Â If it is a filehandle, then output will be
+writing. If it is a scalar reference, output will be appended to this
+scalar. If it is an array reference, output will be pushed onto this
+array as it is generated. If it is a filehandle, then output will be
sent to this filehandle.
Finally, it is possible to pass an object for this parameter, in which
@@ -460,7 +460,7 @@
This should be a hash reference where the keys are characters
sequences that should be escaped and the values are the escaped form
-of the sequence. Â By default, this module will escape the ampersand
+of the sequence. By default, this module will escape the ampersand
(&), less than (<), greater than (>), double quote ("), and apostrophe
('). Note that some browsers don't support the ' escape used for
apostrophes so that you should be careful when outputting XHTML.
@@ -482,7 +482,7 @@
=item -- EncodeTo
-The character set encoding in which output should be encoded. Â Again,
+The character set encoding in which output should be encoded. Again,
this defaults to UTF-8.
=item -- QuoteCharacter
@@ -588,10 +588,9 @@
=head1 THE ENCODER INTERFACE
Encoders can be plugged in to allow one to use one's favourite encoder
-object. Presently there are two encoders: Iconv and NullEncoder, and
-one based on C<Encode> ought to be out soon. They need to implement
-two methods, and may inherit from XML::SAX::Writer::NullConverter if
-they wish to
+object. Presently there are two encoders: Encode and NullEncoder. They
+need to implement two methods, and may inherit from
+XML::SAX::Writer::NullConverter if they wish to
=over 4
@@ -604,6 +603,11 @@
Converts that string and returns it.
=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.
=head1 CUSTOM OUTPUT
Modified: trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm?rev=61721&op=diff
==============================================================================
--- trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm (original)
+++ trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm Thu Aug 19 08:25:00 2010
@@ -481,14 +481,14 @@
# also, there's order in the pseudo-attr
my $xd = '';
if ($data->{Version}) {
- $xd .= "<?xml version='$data->{Version}'";
+ $xd .= "<?xml version=\"$data->{Version}\"";
if ($data->{Encoding}) {
- $xd .= " encoding='$data->{Encoding}'";
+ $xd .= " encoding=\"$data->{Encoding}\"";
}
if ($data->{Standalone}) {
- $xd .= " standalone='$data->{Standalone}'";
- }
- $xd .= '?>';
+ $xd .= " standalone=\"$data->{Standalone}\"";
+ }
+ $xd .= "?>\n";
}
#$xd = $self->{Encoder}->convert($xd); # this may blow up
More information about the Pkg-perl-cvs-commits
mailing list