b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Technical Reference
  4. Charset Handling

Charset Handling

Input/Output Charset

b2evolution 1.8 and above will attempt to convert all data it outputs to the $io_charset . Versions 0.x did not do any conversion.

Charset conversion requires that the PHP mb_strings extension is available.

Note: by "data" we mean everything that comes from the database. The skin templates for example will remain untouched, so make sure your skins are written in a charset compatible with your $io_charset. Default skins are written in plain 7 bits ASCII, so they are compatible with just about anything.

b2evolution 1.8 and above will also expect any incomming data to be encoded in the $io_charset.

The $io_charset is typically defined automatically by the ‘'’current locale”’.

  • The current locale is defined by the locale of the blog you are currently viewing.
  • However, if you are not viewing a blog page (but a backoffice page for example), the current locale is defined by your user profile.
  • Finally, if you are not even logged in, the current locale is the ‘'’default locale from database”’ (Regional settings), $default_locale defined in /conf/_locales.php or the one ‘'’detected from the browser”’ (in this order).

Experimenting in b2evolution version 1.9 beta, you can force the $io_charset to a specific charset by setting $force_io_charset_if_accepted in /conf/_locales.php . This can be used to force all outputs to UTF-8 for example.

Internal Charset

By default, the internal charset $evo_charset is left empty in /conf/_locales.php which means it will follow the $io_charset.

In most cases this will work fine.

Database Charset

MySQL also has its own charset for storing content in the database.

  • If your $io_charset will always be the same (if you blog only in one language it most likely will), it is most efficient to use that same charset for your MySQL database (see MySQL documentation – you can check MySQL charsets with PhpMyAdmin).
  • If you use multiple languages and charset for your blogs, you should try to use a MySQL charset which is compatible with all your I/Os. UTF-8 comes in handy here. Note that using UTF-8 requires MySQL 4.1 .

Conversion from the MySQL charset to the b2evo internal charset ($evo_charset) will be done directly by the MySQL client library ( "the MySQL connection") through the use of a "SET NAMES" command.

If you need to upgrade the encondig of your database to UTF-8, please read this: Upgrading your database to UTF-8.

Created by fatimahnasra • Last edit by fplanque on 2020-06-09 00:24 • •

No feedback yet

On this page

  • Input/Output Charset
  • Internal Charset
  • Database Charset

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
    • Debugging
    • Technical Reference
      • Plugin API for item settings
      • URL Parameters
      • Roadmap & Unified Process
      • Charset Handling
      • Date Format
      • Technical Documentation
      • Image Sizes
      • Database Diagram
      • Username Autocomplete
      • Helper CSS Classes
      • Responsive images
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
b2

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque