XML-RPC and UTF-8

 
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Bug reports -> Bugs in 2.4.x
View previous topic :: View next topic  
Author Message
maximvelichko
New Poster
New Poster

Joined: 06 Feb 2008
Posts: 4
add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Wed Feb 06, 2008 9:07    Post subject: XML-RPC and UTF-8 Reply with quote

Hello

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

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? Smile
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
Back to top
View user's profile Send private message
momokuri
New Poster
New Poster

Joined: 19 Nov 2005
Posts: 4
Reputation: 35.5Reputation: 35.5Reputation: 35.5Reputation: 35.5 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Thu Oct 16, 2008 23:43    Post subject: It may Reply with quote

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 Smile

Hiroshi
Back to top
View user's profile Send private message Visit poster's website
sam2kb
da ruski mafia

Joined: 02 Dec 2007
Posts: 2927
Reputation: 162.4Reputation: 162.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 53

PostPosted: Sat Dec 20, 2008 17:43    Post subject: Reply with quote

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

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

_________________
Russian b2evolution | Download
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Bugs in 2.4.x All times are GMT - 5 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
b2evolution Support Forum RSS Feed Forums powered by php Bulletin Board