]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 426899: Hack SOAP::Lite to encode upper-ASCII characters correctly for the WebSer...
authormkanat%bugzilla.org <>
Tue, 29 Apr 2008 03:04:31 +0000 (03:04 +0000)
committermkanat%bugzilla.org <>
Tue, 29 Apr 2008 03:04:31 +0000 (03:04 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

Bugzilla/WebService.pm

index a2313803d57e4e0a68eada9e91f143b250da52a8..94dbb621778ab2695a2ed3a65f8c0c8830c6c00c 100755 (executable)
@@ -112,6 +112,16 @@ sub new {
     return $self;
 }
 
+sub as_string {
+    my $self = shift;
+    my ($value) = @_;
+    # Something weird happens with XML::Parser when we have upper-ASCII 
+    # characters encoded as UTF-8, and this fixes it.
+    utf8::encode($value) if utf8::is_utf8($value) 
+                            && $value =~ /^[\x00-\xff]+$/;
+    return $self->SUPER::as_string($value);
+}
+
 1;
 
 __END__