1

inserting telugu characters as category

enter image description here

But It Shows Like This

enter image description here

  • I believe that the following should help you https://stackoverflow.com/questions/1198701/storing-and-displaying-unicode-string-%E0%A4%B9%E0%A4%BF%E0%A4%A8%E0%A5%8D%E0%A4%A6%E0%A5%80-using-php-and-mysql – Altimus Prime Jun 24 '17 at 02:50
  • It is probably a good idea though to share more context about what you are doing. How are you interfacing with mysql? – Altimus Prime Jun 24 '17 at 02:53
  • Here is the answer to your question https://stackoverflow.com/a/43449998/4677060 – Geordy James Jun 24 '17 at 04:22

4 Answers4

2

I was facing same issue for UTF-8 characters, Everything was working on live server and staging server, but sometime it's breaking on my dev machine. The behavior was so strange, some times characters was encoded properly but on random page reload it was start breaking with Diamond Charters '���เห็นอเวิลด์!���' or Question mark '??�เห็นอเวิลด์!???' or 85% data was rendering properly 'เห็นอเวิลด์!?��' but rest 15% was showing unmatched characters. I was looking to fix the issue. So, started with my checklist

1 - Check if Character Header Added in HTML


2 - Check if data proper saved in MySQL table


3 - Check if MySQL has proper encoding settings for UTF-8


4 - Check if Apache has Setting to deal with UTF-8 Character set


5 - Check if simple PHP can echo "เห็นอเวิลด์" output same as input "เห็นอเวิลด์"


6 - Check if PHP sending proper Headers output


7 - Check if MySQL Query getting same data "เห็นอเวิลด์"


8 - Check if "เห็นอเวิลด์" has some html characters, deal with them properly


9 - Check if "เห็นอเวิลด์" passing through any html encode decode function


10- Check if .htaccess all set to deal with UTF-8 Character set


Check all the above list to figure out where something..breaking.

Give a try (I am using Codeigniter):

=================================
:: PHP ini Settings::
=================================

default_charset = "utf-8"
mbstring.internal_encoding=utf-8
mbstring.http_output=UTF-8
mbstring.encoding_translation=On
mbstring.func_overload=6 

=================================
:: .htaccess Settings::
=================================

DefaultLanguage en-US
AddDefaultCharset UTF-8

=================================
:: HTML Header Page::
=================================

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

=================================
:: PHP Codeigniter index.php ::
=================================

header('Content-Type: text/html; charset=UTF-8');

=================================
:: Codeigniter config.php ::
=================================

$config['charset'] = 'UTF-8';

=================================
:: Codeigniter database.php ::
=================================

$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';

=================================
:: Codeigniter helper function (optional)
=================================

if(!function_exists('safe_utf_string')){
    function safe_utf_string($utf8string= ''){
        $utf8string = htmlspecialchars($utf8string, ENT_QUOTES, 'UTF-8');
        return mb_convert_encoding($utf8string, 'UTF-8');
    }
}

Good luck!! :)

Nono
  • 6,986
  • 4
  • 39
  • 39
1
  • First check for UTF8 compatibility with this query. If it supports you should see the output as “Character_set_system”| “UTF8”
  • SHOW VARIABLES LIKE ‘character_set_system’;
  • Now that being checked, alter the table and just modify the column, Posts in our above example and specify it as UTF8
  • ALTER TABLE articles MODIFY Posts VARCHAR(20) CHARACTER SET UTF8;

Now, try to insert the telugu characters value and save it.

Sunil Rajput
  • 960
  • 9
  • 19
1

PLease check below mentioned solution.

When you use any regional language apart from English at that time your Charset will be utf8 and set Collection = utf8_general_ci.

Let me know if it not works.

Alex Mac
  • 2,970
  • 1
  • 22
  • 39
0

Go to your table, (select the table)Then click on "structure" and then change the collation to "utf8_general_ci". After this add data and see, It worked for me

andy
  • 1
  • 1