How to deal with Strange Garbage Characters in database

How to deal with Strange Garbage Characters in database

Read Time:1 Minute, 57 Second

As a developer you might have faced the strange characters like 桃園堚臉頜藠桃園堚臉 頜蘊能釠桃園藠文一店 in the database. So what is this? why your getting this type of characters?

If you would like to know and want to resolve it then just keep in touch with us and we will let you know how to deal with this type of situation.

Well the weird characters like this 桃園堚臉頜藠桃園堚臉 頜蘊能釠桃園藠文一店 is due to the wrong character format selection. This happens when you open the file in different file format.

Or the reason could be, due to unsupported file format. Like you opened an excel file in notepad++ or the db file in the MS word. The office version like 2007, 2016, 2019 also matters.

As I have researched, most of the time people get this error in the web development field while dealing with databases. So if you ever encounter with it, then here’s how to fix it

You need to tell to MySQL that the connection must be made in UTF-8. To do so use the function mysql_set_charset (you need PHP 5.2.3). If you use PHP < 5.2.3 try :

mysql_query(“SET character_set_results = ‘utf8’, character_set_client = ‘utf8’, character_set_connection = ‘utf8’, character_set_database = ‘utf8’, character_set_server = ‘utf8′”, $conn);

Also make sure the headers tells that the document is in UTF-8 (header function and/or HTML meta tags correctly set).

Also make sure your PHP files are saved in UTF-8 without a BOM.

You may also check other sources and take the expert advice and resolve this issue quickly without the help of any third-party app or services.

About Post Author

Rv. Cooper

Rv. Cooper is an experienced news writer known for their accuracy, timeliness, and compelling storytelling. They have covered a range of beats and their work has been featured in prominent publications.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous post Interview Ceo Amon Nvidiaarmtibkencnet
Octavia Red Slippery Bounty Next post All About Octavia Red Slippery Bounty You Should Know