Good all the time of day, gentlemen (a question in the style of Monsieur).

There is a variable - the contents of the dowry. Carabas when displaying in the browser - no problem . But when writing to the database, and then reading it, it is a caravan. If I copy from the monitor, or from the source code, pull it out - copied, in the form I need, i.e. no problems. Now, I get the data from the database / table - I manually transfer the data to the same database / table. Handles - not very productive 8-)

The question is: is it possible to output a variable in PHP, in any way, and copy what the browser brought out, then equate the variable to a new value. those. with simulate output / copy / write

ps How to make from scratch without Kakakozyabr - no question, I can. That's not the question.

pps PHP, JS, JQ - the method is not interested. Performance - it does not matter, the main thing is not hands.

ppps tried to write the source code of the page to a text file - Caracozybras. If you copy-paste - no problem. So I think it's not in the encoding when writing.

    3 answers 3

    I think you are doing nonsense.

    Try this: “ How to recognize krakozyabry? "

    But if religion forbids transcoding is simple and difficult, and it is a browser, try automation tools / CI like Selenium or Capybara . Selenium IDE , in theory, should be enough.

    • Furiously plus. Thanks for the link. - ReinRaus
    • The link is good. Can be taken on board. Only I asked something else - sergey
    • Did you mean parsing? hashcode.ru/questions/132350/parsing-html-pages - atnartur
    • Parsing thing is good. Tried it already. Karakozyabry are copied 1 to 1. I also tried to determine the encoding of a variable, and replace it with a special command. Another iframe load and catch GET'om. Yes, a lot of things. As a result, there is data that I can output without glitches, and if I copy everything, then everything works, there are no other ways. So I ask. Interests, any method emitting copy-pasteine. - sergey

    Check the encodings of the tables of the base (in the "operations") and the encodings of the fields of the tables (in the "structure"). You can also try to add these lines to the file where the connection to the database takes place.

    mysql_query("SET NAMES 'utf8'"); mysql_query("SET collation_connection='utf8_general_ci"); mysql_query("SET collation_server='utf8_general_ci'"); mysql_query("SET character_set_client='utf8'"); mysql_query("SET character_set_connection='utf8'"); mysql_query("SET character_set_results='utf8'"); mysql_query("SET character_set_server='utf8'"); 
    • Insult, I already wrote that I tried to change the encoding, before creating the theme. The question is not how to display data from the database, but how to calculate, correct, and write. While working only with pens. - sergey

    Oral man stomped to the side of the encoding. Please read about my.cnf .

    • Karakozyabry successfully dismantled, thank you. The question is not about recognition unfortunately. 8- ( - sergey