Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8616579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:39:12+00:00 2026-06-12T05:39:12+00:00

I am trying to post to my wordpress site by xml-rpc. I have two

  • 0

I am trying to post to my wordpress site by xml-rpc.

I have two problem about the turkish charcters.

1 – When i use one of theese characters (Çç,Ğğ,Iı,Öö,Şş,Üü) in the title sends a post to wordpress without title.?

2 – And when i use form same charcters in body content it sends in different form.

For example in body content i have “Ankaralıyım” an dit goes to wordpress as “Ankaralýyým“.

Here is the code I use

 <?php
$title="Karaçay";
$body="Ankaralıyım";

$rpcurl="http://localhost/wp/xmlrpc.php";
$username="admin";
$password="pass";
$categories="try";

echo wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$categories,'');

function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords='',$encoding='UTF-8') 
{
    $title = htmlentities($title,ENT_NOQUOTES,$encoding);
    $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);

    $content = array(
        'title'=>$title,
        'description'=>$body,
        'mt_allow_comments'=>0,  // 1 to allow comments
        'mt_allow_pings'=>0,  // 1 to allow trackbacks
        'post_type'=>'post',
        'mt_keywords'=>$keywords,
        'categories'=>array($category)
    );
    $params = array(0,$username,$password,$content,true);
    $request = xmlrpc_encode_request('metaWeblog.newPost',$params, array('encoding'=>'UTF-8'));
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
    curl_setopt($ch, CURLOPT_URL, $rpcurl);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1);
    $results = curl_exec($ch);
    curl_close($ch);
    return $results;
}

?>

I do not have any language problem when i add the post from wordpress.

How i will fix this?

And i have tried the same thing with different code and this time if there was any turkish character in the title or post I got this result
Error while creating a new post-32700 : parse error. not well formed
Second code is

<?php
        require("class-IXR.php");  
        $client = new IXR_Client('http://localhost/wp/xmlrpc.php');

        $USER = 'admin';
        $PASS = 'pass';

        $content['title'] = 'Test title '.mt_rand();
        $content['categories'] = array("NewCategory","Nothing");
        $content['description'] = '<p>Lorem ırmak ipsum dolor sit amet</p>';
        $content['custom_fields'] = array( array('key' => 'my_custom_fied','value'=>'yes') );
        $content['mt_keywords'] = array('foo','bar');

        if (!$client->query('metaWeblog.newPost','', $USER,$PASS, $content, true))
        {
            die( 'Error while creating a new post' . $client->getErrorCode() ." : ". $client->getErrorMessage());  
        }
        $ID =  $client->getResponse();

        if($ID)
        {
            echo 'Post published with ID:#'.$ID;
        }

?>

This was the two different way to send post to wordpress by xml-rpc. But chacters different than english doesnt work. What i know there is utf-8 support of xml-rpc.

  • I have already checked many sites and there was a solution with dead link.
    dead link is http://thr.gen.tr/php/xmlrpc-turkce-karakter-sorunu.html
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:39:13+00:00Added an answer on June 12, 2026 at 5:39 am

    You should add escaping->markup parameter to xmlrpc_encode_request:

    xmlrpc_encode_request('blogger.newPost',$params,
                                array('encoding'=>'UTF-8','escaping'=>'markup'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wordpress based classifieds site, i am trying to create and xml
Im trying to have 2 different sites in one place, first site with wordpress
I am trying to display a WordPress post on the homepage of a site.
I have a Wordpress Installation. I have about 3 x custom post types on
I'm trying to write a template for a Wordpress site to use as a
I am trying to post some java code snippets on wordpress.com using the following
I am trying to create a zip file from post attachments in wordpress .
Help, I'm trying to create a new post in my wordpress blog with custom
I'm looking to build a mobile version of a WordPress site and have most
I had a wordpress site installed in a sub folder with category/post-title permalink structure,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.