Answer the question
In order to leave comments, you need to log in
How to get the user's first and last name in Cyrillic?
The server application, referring to the users.get () method, receives in response the name and surname in Latin: instead of "Seryoga" and "Sokolov", I get "Seryoga" and "Sokolov".
I spied on the native vk authorization widget, it refers to a separate script vk.com/widget_auth.php, and that one, handsome, returns the first name and last name in Cyrillic, in the company of other user data. It is not yet possible to access the same php itself - it requires some kind of hash parameter, which is not yet clear how to calculate.
Query parameters from the widget, if someone needs it: act=a_auth_user&app=12345&hash=blahblah
Question: how to get from VK by user id, his first name and last name in Cyrillic, if he entered them in Russian?
Answer the question
In order to leave comments, you need to log in
Understood .
My server "calls" to api.vk.com using curl. It is necessary to explicitly specify the accepted languages in the HTTP header Accept-Language
.
Maybe the geographic location of the server affects: I drive from Amazon's EC2 somewhere in Virginia. And VK decided that if so, then it’s better to answer “Hello!”.
The line that returned Cyrillic in VK api responses:
curl_setopt_array( $ch, array(
CURLOPT_HTTPHEADER => array('Accept-Language: ru,en-us'),
...
));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question