We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

UTF-8 (mysql)

Hello (again),

I'm loving phalcon. Straight forward, just good.

But now I'm desperated a little bit.

I connect to the database with the following configuration:

'database' => array(
        'adapter'     => 'Mysql',
        'host'        => 'localhost',
        'username'    => 'secret_user',
        'password'    => 'secret_pwd',
        'dbname'      => 'database_name',
        "charset"     => "utf8"
    ),

--comment: tried also "charset" => "utf8mb4"

public/index.php starts with

<?php

error_reporting(E_ALL);
mb_internal_encoding("utf-8");
try {

views/index.volt starts with

<!DOCTYPE html>
<html lang="de">
    <head>
        <meta charset="utf-8">
        {{ get_title() }}
        {{ stylesheet_link('css/bootstrap.css') }}

MySQL-Database tables has collation utf8_mb4_general_ci.

For testing I've entered a row with many 'Ü', 'Ä', 'Ö' - using phpmyadmin. Everything looks good there.

But when I load the data with phalcon the white questionsmarks on black carets appear. I'm using Volt for the output.

Tried to insert data from phalcon to mysql, the special characters are not stored properly :(

Where is my error?

Thanks a lot -- again!

Thanks a lot!

Put it into the wrong position. O:)