burger
infomaniak
infomaniak
cloud-computing-logo
Cloud Computing
web-domain-logo
Web & Domains
event-marketing-logo
Events & Marketing
  • Our products
    • Collaborative tools icon chevron
    • Web & Domains icon chevron
    • Cloud Computing icon chevron
    • Events & Marketing icon chevron
    • Streaming icon chevron

      ksuiteCollaborative suite

      Discover the collaborative suite β†’ Discover β†’
    • kSuite Professional email, sovereign cloud and AI for sustainable performance
    • kSuite The suite for secure communication, storage and sharing
    • kdrive
      kDrive Store, collaborate and share your files
    • mail service
      Mail Service Create your email addresses with your domain
    • kChat
      kChat Communicate live with your teams
    • kmeet
      kMeet Organise your meetings online in complete security
    • swisstransfer
      SwissTransfer Send your files up to 50 GB free of charge.
    • kpaste
      kPaste Share and encrypt your sensitive information
    • ksuite
      Custom Brand Control the brand image of your products
    • kChat
      Chk Link reducer & QR code generator
      Find the web hosting solution you need
    • Domain name
      Domain name Reserve your domain name at the best price
    • Site Creator
      Site Creator Create your website with ease
    • web hosting
      Web Hosting Create your website with over 100 CMS
    • web hosting
      Wordpress Hosting Create your WordPress website easily
    • Cloud Server
      Cloud Server Power up your sites with guaranteed resources
    • Node.js Hosting Create a dynamic, interactive site with Node.js
    • SSL Certificat
      SSL certificates Secure your websites with an EV or DV certificate
    • Options
    • Domain privacy
      Domain Privacy Protect your domains’ private data
    • DNS Fast Anycast
      FastAnycast DNS Speed up your site access times
    • Dyn DNS
      DynDNS Access your devices remotely
    • Dyn DNS
      Renewal Warranty Secure your domains against loss and theft
      Find the right Cloud Computing solution

      Cloud services

    • public cloud
      Public Cloud (IaaS) Create your projects in a high-end, ultra-competitive Cloud
    • Cloud Server
      VPS Cloud Create a Windows / Linux server
    • Kubernetes service Deploy your containerised apps on a large scale.
    • VPS Lite
      VPS Lite Create a Windows/Linux server at a low cost
    • Database Service Manage your databases with a managed solution
    • jelastic cloud
      Jelastic Cloud (PaaS) Create your own customised environments
    • Other services

    • llm api
      AI Tools Boost your productivity with our sovereign AI
    • swiss backup
      Swiss Backup Back up your devices in the Cloud
    • nas synology
      NAS Synology Rent a NAS in our secure data centers
    • High availibility
      Very High Availability Create a multi-data center infrastructure with customised SLAs
    • Housing
      Housing Install your servers in our data centers
    • Auth Add a privacy-friendly login method to your apps
      Infomaniak Events, the independent local events portal
      Online ticketing service with a wide choice of concerts, shows and events.
    • online shop
      Ticketing Create your ticketing service and sell tickets
    • kdrive
      Access Control Control access to your events with ease
    • kdrive
      Guest manager Automate your event invitations
    • kdrive
      Newsletter Send your newsletters at competitive prices
    • Streaming radio
      Streaming radio Create and broadcast your own live radio station online
    • streaming video
      Video-Streaming Create and broadcast live events and TV online
    • VOD and AOD
      VOD & AOD service Host and broadcast your recordings without limits
  • Resources
    documentation icon Documentation
    Guides & tutorials
    API documentation
    special offers icon Special offers
    Get started for free
    Student programme
    Become an affiliate
    partner program icon Partner programme
    Find a partner
    Become a partner
    support icon Support & contact
    Contact Support
    Premium support - 24/7
    Contact our sales department
    Hiring an expert
    Migrate to Infomaniak
  • About us
    forest
    icon Ecological commitment
    We pollute. But we are taking action to reduce the footprint of our services and infrastructure
    Discover our commitment β†’
    icon About Infomaniak
    Our vision, our values
    Our teams
    Infomaniak is recruiting
    Press and communication
    Blog and news
    icon Security
    Data confidentiality
    Bug Bounty Programme
  • Get started for free
    Sign in
  • search-icon
    close-icon
      icon

      Would your needs exceed our solutions? To find out, contact us so that we can advise you personally.

      Our flagship products:
  • search-icon
  • Get started for free
    Sign in
Price Price
Knowledge base

1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!

Knowledge base Solve a page encoding problem

    Solve a page encoding problem

    This guide is for developers and webmasters experiencing issues displaying special characters (such as accents, Arabic characters, Chinese characters, emojis, etc.), whether on an Infomaniak website or in its database.

     

    Preamble

    • Common causes of incorrectly displayed characters that appear instead of special characters or emojis like ??:
      • PHP connection in utf8 instead of utf8mb4
      • MySQL table or column in latin1 or utf8 instead of utf8mb4
      • SQL file encoded differently from the import parameter
      • HTML/CSS/JS files improperly encoded
      • Missing or incorrect charset declaration on the HTML, PHP, or HTTP side
    • Common solutions:
      • Use utf8mb4 everywhere: database, connections, tables, columns, files, headers
      • Validate the encoding of all files and dumps
      • Test the display of emojis, accents, and other multilingual characters
    • Also refer to this other guide to force another encoding when connecting to a MySQL database.

     

    Use a text editor that supports saving in UTF-8 without BOM (Visual Studio Code, Sublime Text, Notepad++...)

     

    1. Use UTF-8 or UTF-8MB4 everywhere

    The utf8 encoding of MySQL does not support characters on 4 bytes, like emojis. These will display as ??. Therefore, you should use utf8mb4, which is a true complete implementation of UTF-8.

     

    2. HTML – Correct encoding declaration

    In the <head> of your HTML pages:

    <meta charset="UTF-8">

    Make sure that CSS/JS files are also saved in UTF-8 (without BOM).

     

    3. PHP – Force UTF-8 or UTF-8MB4

    a) HTTP headers

    header('Content-Type: text/html; charset=utf-8');

    b) MySQL Connection (MySQL API)

    $connection = mysql_connect($host, $user, $pass);
    mysql_set_charset('utf8mb4', $connection);

    c) PDO Connection

     $dsn = "mysql:host=localhost;dbname=ma_base;charset=utf8mb4";
    $pdo = new PDO($dsn, $user, $pass, [
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
    ]);

     

    4. MySQL database

    a) Configuration in phpMyAdmin

    • Databases, tables, and columns should be in utf8mb4_unicode_ci or utf8mb4_general_ci.
    • In the Operations tab, select utf8mb4_unicode_ci for the collation.

    b) Useful SQL commands

    ALTER DATABASE ma_base CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
    ALTER TABLE ma_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

    c) After the PHP connection

    mysqli_query($conn, "SET NAMES 'utf8mb4'");
    mysqli_query($conn, "SET CHARACTER SET 'utf8mb4'");

     

    5. .user.ini / .htaccess file

    To force encoding on the server side (Apache):

    AddDefaultCharset utf-8
    Header set Content-Type "text/html; charset=utf-8"
    # Pour PHP
    php_value default_charset UTF-8
    php_value mbstring.internal_encoding UTF-8

     

    6. Import / export of SQL dumps

    Errors such as é becoming ? or an emoji ☺ becoming ?? often stem from encoding misalignment.

    Check the encoding of the SQL file before import. Use iconv if necessary:

    iconv -f ISO-8859-1 -t UTF-8 dump.sql > dump_utf8.sql

    In phpMyAdmin, specify the import encoding (for example UTF-8, UTF-8MB4 or latin1 depending on the file).



    Link to this FAQ:
    Has this FAQ been helpful?
    Thank you for your feedback. Improve this FAQ?
    Please do not ask any questions through this form, it is only used to improve our FAQ.
    Please use our contact form for any question.
    Your message has been sent. Thank you for suggesting an improvement to this FAQ.
    Display all FAQs for this product
    logo infomaniak
    Prices do not include VAT
    facebook
    twitter
    linkedin
    instagram

    Infomaniak

    About Infomaniak The team Infomaniak is recruiting Press space Infomaniak blog All certificates Products and offers Clients' opinions

    Support

    Assistance 7/7 FAQ and guides Premium Support Sales contact API REST Report abuse WHOIS Statuts Public Cloud Service status

    Partnerships

    Become a reseller Affiliate programme Directory of partners Requests for quotes

    Ecology

    Green hosting Certificates & awards

    Follow our development

    The email entered is invalid
    earth icon
    • EN
      • EN
      • DE
      • ES
      • FR
      • IT
    Β©2025 Infomaniak - Legal documents - Legal notice - Data Protection - Privacy Policy - Site map - Manage your cookies
    icann-logo
    swiss
    new-iso
    swiss-hosting
    logo infomaniak
    Prices do not include VAT

    Infomaniak

    About Infomaniak The team Infomaniak is recruiting Press and media Infomaniak blog All certificates Products and offers Clients' opinions

    Support

    Assistance 7/7 FAQ and guides Premium Support offer Sales contact API REST Report abuse WHOIS Statuts Public Cloud Service status

    Partnerships

    Become a reseller Affiliate programme Directory of partners Requests for quotes

    Ecology

    Green hosting Certificates & awards

    Follow our development

    The email entered is invalid
    icann-logo
    swiss
    new-iso
    swiss-hosting

    facebook
    twitter
    linkedin
    instagram
    Β©2025 Infomaniak
    Contracts - Legal notice - Data Protection - Privacy Policy - Site map - Manage your cookies

    Managers

    earth icon
    • EN
      • EN
      • DE
      • ES
      • FR
      • IT
    Your browser is outdated, security and browsability are no longer guaranteed. We recommend that you update it as soon as possible by clicking here.