There is a post request in which Cyrillic words can be transmitted. How do I process this request so that the Cyrillic alphabet is displayed normally? If yuzat

header("Content-Type: text/html;charset=windows-1251"); 

That appears on the error getting header, because there is still receiving a post request from a third-party server. How to solve the problem, who knows?

  • There is actually no problem if the post is given correctly. Show how it is formed (no need to dump all the code, show only what does not comply with RFC) - user6550
  • Judging by the question, the vehicle does not know what may not comply with the RFC - Photon
  • Judging by the question, the vehicle does not know about the headlines. And maybe so (turn on the telepath) uses some ready-made code using copy-paste .. - user6550
  • I don’t know about RFC, but the post method. - rimlin

1 answer 1

POST data is usually encoded in UTF-8.

Try: iconv ('UTF-8', 'WINDOWS-1251', $ _POST ['variable']);

  • It depends on what this post-request is sent .. If via ajax, then exactly utf-8, if just a form, then the encoding corresponds to the encoding of the sending page - Photon
  • > POST data, as a rule, give a link to the rule, pls. - user6550
  • The author expressed a problem with the encoding, it was logical to assume that AYAX is used at a minimum. - istem 5:46
  • iconv ('utf-8', 'windows-1251', $ _REQUEST ["var"]) - did not help, or rather the variable == '' - rimlin
  • @istem, sorry. What kind of headlines are there, the problem is much deeper - “two is equal” to them ... - user6550