I am working on a custom plugin that import posts from external website.
I use following code to create a post in QA platform with data retrieved from external website.
qa_post_create('Q', null, $title, $content, $format = '', $categoryid, $tags, $userid, $notify = null, $email = null, $extravalue = null, $name = null);
I get $title, $content, and $tags successfully from external website using simple HTML DOM parser. And I use strip_tags() function to remove html tags and keep only text.
Everything is well. the qa_post_create() function creates post. However, in content of just created post there are non-utf-8 characters such as
ý (ý)
ü
“
—
”
Ç (Ç)
Actually, in $title there are also some characters such as (ý), but it appears normal, not as ý. It happens only in content of question.
When I just retrieve the data and print it with echo() or print_r() functions the text appear normal without any irregular symbols. These symbols appear only when I use qa_post_create() function to create question.
Also, when I change format from '' to 'html' in qa_post_create() function, it resolves. But I do not want to use format='html'. Is there any other way to fix it?