Encoding converting PHP [duplicate] - php

This question already has an answer here:
Encoding detecting php
(1 answer)
Closed 8 years ago.
I need help with encoding :(
I have parsed string from site: Ëè÷íûå âñòðå÷è
My site is in UTF-8 encoding.
How to convert parsed string to encoding of my site?
On this site artlebedev.ru/tools/decoder
When I click on "Расшифровать" button, I get right result: Личные встречи.

this does not work you say?
echo iconv("iso-8859-5","utf-8","Ëè÷íûå âñòðå÷è");
then are you sure your file is utf8 also?

try this
echo iconv("cp1251","utf8",iconv("utf8","cp1252","Ëè÷íûå âñòðå÷è"));

Related

How get the decoded contents sent to php server? [duplicate]

This question already has an answer here:
decoding eval(base64_decode))
(1 answer)
Closed 3 years ago.
I have the following encoded codes! It will decode itself and run with eval() function, is any solution to get the decoded codes that run by server?!
<?php /*** PHP Encode v1.0 by zeura.com ***/ $XnNhAWEnhoiqwciqpoHH=file(__FILE__);eval(base64_decode("aWYoIWZ1bmN0aW9uX2V4aXN0cygiWWl1bklVWTc2YkJodWhOWUlPOCIpKXtmdW5jdGlvbiBZaXVuSVVZNzZiQmh1aE5ZSU84KCRnLCRiPTApeyRhPWltcGxvZGUoIlxuIiwkZyk7JGQ9YXJyYXkoNjU1LDIzNiw0MCk7aWYoJGI9PTApICRmPXN1YnN0cigkYSwkZFswXSwkZFsxXSk7ZWxzZWlmKCRiPT0xKSAkZj1zdWJzdHIoJGEsJGRbMF0rJGRbMV0sJGRbMl0pO2Vsc2UgJGY9dHJpbShzdWJzdHIoJGEsJGRbMF0rJGRbMV0rJGRbMl0pKTtyZXR1cm4oJGYpO319"));eval(base64_decode(YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH)));eval(ZsldkfhGYU87iyihdfsow(YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH,2),YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH,1)));__halt_compiler();aWYoIWZ1bmN0aW9uX2V4aXN0cygiWnNsZGtmaEdZVTg3aXlpaGRmc293Iikpe2Z1bmN0aW9uIFpzbGRrZmhHWVU4N2l5aWhkZnNvdygkYSwkaCl7aWYoJGg9PXNoYTEoJGEpKXtyZXR1cm4oZ3ppbmZsYXRlKGJhc2U2NF9kZWNvZGUoJGEpKSk7fWVsc2V7ZWNobygiRXJyb3I6IEZpbGUgTW9kaWZpZWQiKTt9fX0=c86f0c50b87a0b21633e9a7752465da7914bc8bbbZJRa8IwFIXfBf9DLGOJoO3co6NuMgbbg8wH3+Yoobm10ZiEJGXq2H9f0qpQ6dNNz739cnISRh1kDApaCZc5voeTkpBZcATPLafJCkpDJR4+9Xu8QGRQcAEZHLh1luAFZSC4hKVRTsVCbfBwiH77PYQq6fVd54Qn/fV7Xbj9eTjWpb6SEMqVPhJcOqftNEl0SU18mdQ19nA8Ja1/R+iG1ezJZS4qBjdN37tr2UQpkvCD1oxKtVm3Wuv58oPgN8GPdLW4uqj5bcZ4Zh01jtSdEKuHMh81id6nPKpVHyvzaihkMpo8PnRR8pJKCcKOZ1vF5WvzRb7wWcconSH80hgCusDfAVIHFoXAfF5U8zGEvtvHeZH4K1AqnPsZigJyl9Y+7h0c/DIYjUY4lHirN53n0qUv3k+lhaLMi+EKl0H0tsK68XRl1I4gLxXCn7tBSPvyNsAYZbLmTfwD
Have you tried to do this:
echo base64_decode("aWYoIWZ1bmN0aW9uX2V4aXN0cygi ...
?
You should see the encoded code.

PHP utf8_decode some characters decode correctly some not [duplicate]

This question already has answers here:
strange character encoding of stored data , old script is showing them fine new one doesn't
(2 answers)
UTF-8 all the way through
(13 answers)
Closed 4 years ago.
Okay, something went wrong in our database and now all the content from Chinese, Turkish etc. language is messed up (wrong characters). I'm trying to create a PHP script to convert it. Yes, SET NAMES utf8 is executed, everything is utf8mb4_general_ci and the PDO connection has charset utf8.
For example, we got the following text:
Bizimle iletişime geçin
Which is supposed to be:
Bizimle iletişime geçin
Now, if I display the output from the database, it displays the first line what we got in our database (Bizimle iletişime geçin). Then, I use this line:
die(utf8_decode('Bizimle iletişime geçin'));
The output of it is:
Bizimle ileti�?ime geçin
So the ç gets decoded correctly but the ş doesn't.
I tried going to an online utf8-decoder (https://software.hixie.ch/utilities/cgi/unicode-decoder/utf8-decoder) and if I try to decode ÅŸ it does show the ş correctly.

PHP decoding html encoded characters [duplicate]

This question already has answers here:
URL Decoding in PHP
(6 answers)
Closed 6 years ago.
I have problem decoding html encoded character using php, what should i do?
Below is the sample input.
%D8%A7%D8%AB%D8%A7%D8%B1%D9%87 %D8%A7%D9%84%D9%85%D8%B1%D9%87
Below is the sample output i want.
اثاره المره
Use PHP's urldecode function:
urldecode("%D8%A7%D8%AB%D8%A7%D8%B1%D9%87 %D8%A7%D9%84%D9%85%D8%B1%D9%87");

PHP Curl return character [duplicate]

This question already has answers here:
PHP Curl UTF-8 Charset
(6 answers)
Closed 7 years ago.
I'm doing a curl request and I'm getting this reply:-
Expected : "£12709"
Got : "£12709"
I have no clue what "Â" this character is.
I found these two similar SO posts that may be helpful:
PHP Curl UTF-8 Charset
CURL import character encoding problem

PHP encoding error in view file [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Decoding numeric html entities via PHP
I have encoding error in the breadcrumbs (view file)
how can I fix that ? php or html ?
input => Madagascar 3: Europe's Most Wanted
output => Madagascar 3: Europe's Most Wanted
I'm using Yii PHP framework ans MySQL
You need to use this html_entity_decode
Here is a reference http://php.net/manual/en/function.html-entity-decode.php

Categories