projects
/
Net-Plesk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
handle responses with an encoding= (though not actually the encoding)
[Net-Plesk.git]
/
lib
/
Net
/
Plesk
/
Response.pm
diff --git
a/lib/Net/Plesk/Response.pm
b/lib/Net/Plesk/Response.pm
index
53342d5
..
6b9a46e
100644
(file)
--- a/
lib/Net/Plesk/Response.pm
+++ b/
lib/Net/Plesk/Response.pm
@@
-37,9
+37,11
@@
sub new {
my $self = {};
bless($self, $class);
my $self = {};
bless($self, $class);
+ my $encoding = ''; #default
my $data = shift;
my $data = shift;
- if ($data =~ /^\<\?xml version=\"1.0\"\?\>(.*)$/s){
- $data=$1;
+ if ($data =~ /^\<\?xml version=\"1.0\"(\s+encoding="([\w\-]*)")?\?\>(.*)$/s){
+ $encoding = $2; #don't actually do anything with this yet
+ $data = $3;
}else{
$data =~ s/[^\w\s]/ /g; # yes, we lose stuff
$data = '<?xml version="1.0"?>' .
}else{
$data =~ s/[^\w\s]/ /g; # yes, we lose stuff
$data = '<?xml version="1.0"?>' .