S
S
Sergey Sokolov2012-04-24 10:45:04
In contact with
Sergey Sokolov, 2012-04-24 10:45:04

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

2 answer(s)
S
Sergey Sokolov, 2012-04-24
@sergiks

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'),
    ...
));

Documentation on curl options.

M
Mobyman, 2012-04-24
@Mobyman

Translate to google code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question