We have decided to transfer the original system from one server to another.
I imported it using phpMyAdmin because I couldn't type the command directly.
At this time, I tried utf8, sjis, binary, etc. for the "File Character Set:", but the results have not changed.
Test connection with Perl
When Perl connects to the database, there is no garbled characters in Japanese, and the migrated data is read beautifully.This is UTF8.
However, the actual system is PHP, so it was only a confirmation of operation.
Connect via PHP
When connected via PHP, the characters were already garbled at phpMyAdmin, and the desired system only has Japanese characters, so there is no sign of healing.
I tried it by using internet search.
Thank you for your cooperation.
I probably solved it myself, so I will answer it.
After adding the following code to the beginning, you can now display it without garbled characters.
This post was posted as a community wiki based on what @Monon added to the body of the question.
© 2022 OneMinuteCode. All rights reserved.