0

I have tried string in database . I want to display it in webpage . I tried

 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  

Also

 utf8_decode($n1);

Also

html_entity_decode($n1, ENT_COMPAT, "UTF-8");

Nothing works I see the string as it is. I have successfully didplayed this text in android device using URLdecoder method

The sample string is

 %E0%A4%95%E0%A4%B0%E0%A4%A3%E0%A5%80+%E0%A4%AE%E0%A4%BE%E0%A4%81+%E0%A4%97%E0%A5%8D%E0%A4%B0%E0%A5%81%E0%A4%AA+%E0%A4%AA%E0%A5%8D%E0%A4%B0%E0%A4%BE%E0%A4%87%E0%A4%B5%E0%A5%87%E0%A4%9F+%E0%A4%B2%E0%A4%BF%E0%A4%AE%E0%A4%BF%E0%A4%9F%E0%A5%87%E0%A4%A1 

It is in Hindi I hope you can help me .Thank you

2 Answers 2

1

The string you've provided is URL encoded. If you pass it to urldecode(), it'll render just fine:

urldecode("%E0E0[snip]%E0%A4%A1"); //  करणी माँ ग्रुप प्राइवेट लिमिटेड 

http://php.net/manual/en/function.urldecode.php

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. May I ask how you suspected.
You can recognize URL encoded strings by the %-characters. Charset encoding/decoding issues mostly cause characters being rendered as � (replacement character), or other 'weird' characters. By the way, please accept my answer if it solved your question.
0

maybe you need to change the charset in the database
http://php.net/manual/es/mysqli.set-charset.php.
you will need to change it in the code where you connect to the database in the link you can get various examples

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.