I wrote a PHP script that creates 5 databases and inserts some data (using $mysqli->multi_query
). When I tried it out, unicode (ä ö ü ß •) was broken, so I called utf8_decode
on the whole sql query. However, this worked only for ä ö ü, not for ß • and not for uppercase Ä Ö Ü. This really confuses me.
Output of ß: �?Ÿ
I'm not a specialist in different character encodings, but until now, I always managed to get the proper output.
All my files are encoded in UTF-8 and the meta tag
<meta charset="utf-8">
is in every website.
Can someone help me on this?
Here are parts of the SQL query (it's really, really long)
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Erstellungszeit: 22. Mrz 2017 um 21:29
-- Server-Version: 10.1.21-MariaDB
-- PHP-Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!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 */;
CREATE TABLE `forum` (
`id` int(10) UNSIGNED NOT NULL,
`autor` varchar(50) NOT NULL,
`text` varchar(2000) NOT NULL,
`datum` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
. . .
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;