Answer the question
In order to leave comments, you need to log in
PHP: tweeting, caption calculation?
I built authorization through Twitter into the site (I use the Twitter-async library from Jaisen Mathai ), now I want the user to automatically post a message to his Twitter when changing the profile on the site.
But here a problem arises: Russian messages are simply not sent. More precisely, the whole problem is (as I understand it) that the request signature is incorrectly calculated. Googled - many have the same problem, everyone nods towards UTF-8 characters.
I looked at the source code of the library, but there, in theory, everything is fine, each parameter is processed like this:
public function encode($string)<br>
{<br>
return rawurlencode(utf8_encode($string));<br>
}<br>
public function encode($string)<br>
{<br>
return rawurlencode(iconv('windows-1251', 'UTF-8', $string));<br>
}<br>
Answer the question
In order to leave comments, you need to log in
How is the message length checked? my records were in utf-8, as a result, the message length was calculated incorrectly, the messages exceeded the limit and were not published
1. PHP version?
2. Is extension mb_string installed
If PHP < 5.3.10 and there is mb_string, use mb_strlen instead of strlen ( proof )
in 5.4 to calculate the length of the UTF-8 string, seems to be fixed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question