The users.get () API method for some reason returns the first and last name in transliteration.

At the same time, the authorization widget perfectly receives and returns the name and surname in Cyrillic. But I do not want to use it.

Upd. The problem was caused by the geolocation of my server in the states, to which vk chose, apparently, to answer in English.

Solution Add curl requests to the api HTTP header Accept-Language: ru :

 curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept-Language: ru,en-us')); 
  • And I have everything perfectly Cyrillic displayed in users.get. If you are working through JS or something similar, I can assume that the "smart" VKontakte script uses your current locale or something like that. - VioLet
  • Server "phoning", php / cURL. Strange. Look at my id = 755074, will you have Cyrillic where I have "Seryoga"? - Sergiks
  • @sergiks I use the desktop API, so xs (but here is proof of db.tt/riTrozE4 ). Dig in the direction of the locale. - VioLet

2 answers 2

now there is a lang parameter

https://vk.com/dev/api_requests

Passing Parameters to the API Parameters can be passed by either the GET method or POST. If you will transfer large data (more than 2 kilobytes), you should use the POST method.

Each method has its own set of supported parameters, however, there are parameters that all methods accept:

lang - defines the language in which various data will be returned, for example the names of countries and cities. Also, if not specified Russian, Ukrainian and Belarusian language, the Cyrillic names will be automatically translated into Latin. ru - Russian, ua - Ukrainian, be - Belarusian, en- English, es - Spanish, fi - Finnish, de - German, it - Italian. It also supports the numeric language identifier returned by the account.getInfo method.

  • Since 2012, much water has flowed under the bridge :)) Sergiks

Understood. My server is physically located in the states, apparently, therefore, vk api decided to show off and speak in English. Cured by adding the HTTP header Accept-Language: ru all curl requests: curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept-Language: ru,en-us'));