niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl
XML-RPC calls with real UTF8 data failed
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Erik Wasser
*nix forums beginner


Joined: 02 Mar 2006
Posts: 4

PostPosted: Thu Jul 20, 2006 3:40 pm    Post subject: XML-RPC calls with real UTF8 data failed Reply with quote

Today I've tried to do some XML-RPC calls with 3 different libraries.
And I failed. Or - to be more exact - the libraries failed, but read on.
Here's an client example for the 'Frontier::Client' library:

#!/usr/bin/perl

use strict;
use warnings;

use Frontier::Client;
use Data::Dumper;

use utf8;
use encoding 'utf8';

my $client = Frontier::Client->new(
# please ignore the fact that google is not offering
# any services under this adress
url => 'http://www.google.com',
encoding => 'utf-8',
use_objects => 0,
);

print Dumper($client->call('double', 'ä'));

The script have to be saved in UTF8 mode otherwise the umlaut will not
be saved correctly. Here's the output of the RPC request call:

0x0000: 4500 00ce fd6e 4000 4006 8183 0a00 10dc E....n@.@.......
0x0010: 42f9 5d63 c507 0050 574e 1362 7e4c ff2e B.]c...PWN.b~L..
0x0020: 5018 16d0 bbf8 0000 3c3f 786d 6c20 7665 P.......<?xml.ve
0x0030: 7273 696f 6e3d 2231 2e30 2220 656e 636f rsion="1.0".enco
0x0040: 6469 6e67 3d22 7574 662d 3822 3f3e 0a3c ding="utf-8"?>.<
0x0050: 6d65 7468 6f64 4361 6c6c 3e0a 3c6d 6574 methodCall>.<met
0x0060: 686f 644e 616d 653e 646f 7562 6c65 3c2f hodName>double</
0x0070: 6d65 7468 6f64 4e61 6d65 3e0a 3c70 6172 methodName>.<par
0x0080: 616d 733e 0a3c 7061 7261 6d3e 3c76 616c ams>.<param><val
0x0090: 7565 3e3c 7374 7269 6e67 3ee4 3c2f 7374 ue><string>.</st
0x00a0: 7269 6e67 3e3c 2f76 616c 7565 3e3c 2f70 ring></value></p
0x00b0: 6172 616d 3e0a 3c2f 7061 7261 6d73 3e0a aram>.</params>.
0x00c0: 3c2f 6d65 7468 6f64 4361 6c6c 3e0a </methodCall>.

The XML was correctly marked with UTF-8 but the german umlaut is encoded
in one octet (0xe4) but german umlauts are two octets in UTF-8.

The two others libraries (RPC::XML::Client and XMLRPC::Lite) failed in
nearly the same way. But I don't want to pretend that I'm the super
programmer so maybe I'm here the problem.

Is there anyone out there who is using XML-RPC in perl with real UTF-8
parameters (not encoded in Base64)? A lot of example scripts from the
internet are still using plain 7-Bit ASCII and that is not a problem at
all.

Any hints or urls are welcome.

--
So long... Fuzz
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 6:46 pm | All times are GMT
navigation Forum index » Programming » Perl
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Bug#379103: ITP: complearn-gui -- 3D drag-and-drop interf... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 11:00 am
No new posts Bug#379087: ITP: libcomplearn -- data-compression based i... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 7:40 am
No new posts getimagesize():failed to open stream: sree PHP 0 Fri Jul 21, 2006 6:24 am
No new posts How do I render JPEG Data stored in char* buffer? On the Sparrow C++ 2 Thu Jul 20, 2006 8:44 pm
No new posts ANNOUNCE: Data-centric PHP framework (GPL) Kenneth Downs PHP 0 Thu Jul 20, 2006 6:11 pm

Credit Cards | Mortgage Calculator | Online Advertising | Credit Counseling | MPAA
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1176s ][ Queries: 16 (0.0539s) ][ GZIP on - Debug on ]