Recent Topics

XML-RPC and UTF-8

Started by on Feb 06, 2008 – Contents updated: Feb 06, 2008

Feb 06, 2008 15:07    

Hello

I failed to find any relevant information, and I hope this question was not discussed a million times already :D

I use b2evolution 2.4.0 "Venetian" and I try to submit posts using XML-RPC/metaWeblog.newPost method. Finally I managed to control it, hurrah!

However, it turns out that if string values are outside of standard ISO-8859-1 character set, they are replaced with question marks in created posts.

I even found the reason :-)

When the request is parsed in inc/_ext/xmlrpc/_xmlrpc.inc.php, the XML_OPTION_TARGET_ENCODING option is set to the internal encoding. And this encoding is hard-coded to 'ISO-8859-1', when I changed it as below, everything started working just fine:

inc/_ext/xmlrpc/_xmlrpc.inc.php
//$GLOBALS['xmlrpc_internalencoding']='ISO-8859-1';
$GLOBALS['xmlrpc_internalencoding']='UTF-8';

The question is of course - what am I doing wrong? :)
Is there a better way to encode UTF-8 correctly? And what can be affected in my solution?

I can provide extra info (like my exact XML-RPC request) upon an inquiry.

Can you advise anything?

Best regards,
Maxim

Oct 17, 2008 06:43

I also caught same problem with b2evolution 2.4.5 "Monument Valley".
I tried flikr's post service, which support Blogger API.
Characters inside ISO-8859-1 is ok but others such as Japanese is conveted to '?' question mark.

With your modification, the problem is gone.
I think recent b2evolution internal code is UTF-8 by default.
That's because, default value should be UTF-8.

These codes may be external code base but we should use it with proper configuration :)

Hiroshi

Dec 20, 2008 23:43

I had the same problem with Scribefire on UTF-8 b2evo

$GLOBALS['xmlrpc_internalencoding']='UTF-8'; did the trick ;)


Form is loading...

Build your own website! – This forum is powered by b2evolution CMS, a complete engine for your website.