I have a problem with MariaDB on XAMPP (no matter if you are running on Windows or Linux).
I am using XAMPP with PHP 7 (initially I used a XAMPP 5.6 on Xubuntu and the same problem occurs) in Windows 10 as my site development server. I set it:
- The meta tag has UTF-8 in all HTML archives,
- The PHP header function to send UTF -8 data,
- The PHP directives, when I connect to the DB (I use MySQLi)
- The default_coding on php.ini is setted for UTF_8,
- And all the database is set in utf8_general_ci collation.
I used phpMyAdmin embedded in XAMPP to enter test data ,in the first test was creating fields in phpMyAdmin itself, in the second test used the feature to export data from a CSV file (the file has been set to UTF-8 encoding).
What happens is that when I try to make a query to the database and then try to display the data obtained from this query, accented characters are all with question marks, forcing to treat the information obtained from the database with the function utf8_encode.
I do not bother with it at the time, but when transferred my site to the production server (not XAMPP), the data coming from the database and treated with utf8_encode function were displaying (in all browsers) in place of those accented characters only question marks (?) and exclamations (!). I had to take the calls utf8_encode and solved the problem.
In both servers submitted the same SQL file and eventually occurring this difference in operation . The only difference is that the production server phpMyAdmin did not accept the following header of my SQL file:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */
Here are the server settings:
XAMPP deployment server:
- PHP 7.0.4
- MariaDB 10.1.10
- phpMyAdmin 4.5.1
- PHP 7.0.4
- phpMyAdmin 220.127.116.11
- MariaDB 10.0.24
Please help me!