Okay, I verified, recreated, exported, re-recreated my tables so everything is in UTF-8 character set:
-- phpMyAdmin SQL Dump
-- version 3.2.0
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 05, 2009 at 09:01 PM
-- Server version: 5.1.35
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `restaurant`
--
CREATE DATABASE `restaurant` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `restaurant`;
-- --------------------------------------------------------
--
-- Table structure for table `categorie`
--
CREATE TABLE IF NOT EXISTS `categorie` (
`IdCategorie` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`LibCategorie` varchar(255) NOT NULL,
`OrdreCategorie` tinyint(3) unsigned DEFAULT NULL,
PRIMARY KEY (`IdCategorie`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5;
--
-- Dumping data for table `categorie`
--
INSERT INTO `categorie` (`IdCategorie`, `LibCategorie`, `OrdreCategorie`) VALUES
(1, 'Entrées', 1),
(2, 'Plats', 2),
(3, 'Desserts', 3),
(4, 'Boissons', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `plats`
--
CREATE TABLE IF NOT EXISTS `plats` (
`IdPlats` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`LibPlats` varchar(255) NOT NULL,
`PrixPlats` decimal(5,2) DEFAULT NULL,
`IdCategorie` smallint(6) NOT NULL,
PRIMARY KEY (`IdPlats`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
--
-- Dumping data for table `plats`
--
INSERT INTO `plats` (`IdPlats`, `LibPlats`, `PrixPlats`, `IdCategorie`) VALUES
(1, 'soup chinois', '2.99', 1),
(2, 'soup russe', '2.49', 1),
(3, 'bienenstich', '2.79', 3),
(4, 'steak haché', '6.99', 2),
(5, 'gratin dauphin', '6.39', 2),
(6, 'mohnpielen', '2.75', 3),
(7, 'canard aigre-doux', '7.29', 2),
(8, 'coca zéro', '1.59', 4),
(9, 'coca light', '1.59', 4),
(10, 'coca cola', '1.79', 4),
(11, 'perri-air', '18.99', 4),
(12, 'thé', '2.19', 4),
(13, 'café', '3.39', 4),
(14, 'eau plat', '1.29', 4);
Yet the PHP code still produces the rectangles instead of the correct character set.
So I think that in the case of unicode (UTF-8) characters, the queries have to be declared UTF-8. (Yeah, it makes sense to declare the charset encoding as early and globally as possible.)
Should the if-condition testing $_POST's contents be necessary at some later point, I'll ask again.