Main  /  Edit version 2  /  Edit version 3  /   /  Users Area

Difference "Encoding and UTF8" ver. 2 versus ver. 3

Content:

Today, UTF8 is widely considered as the standard encoding for the web. Thus, it is important that your application handles encoding problems properly.
## HTTP
It is not enough that the template of your HTML page contains the following declaration:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--toc-->
The page must be sent over HTTP over a UTF-8 connection, as declared in the HTTP headers. To achieve this, you must add a UTF-8 locale in the configuration file of your cppcms application, e.g.:
"localization" {
"locales" : [ "en_US.UTF-8" ]
}
## SQL
The default encoding of the connection to your SQL server may not be UTF-8. To ensure that the data which is stored as UTF-8 in your database is retrieved appropriately, make sure to configure the connection to use UTF-8:
cppdb::session sql(database_connection_string);
sql << "SET NAMES \"utf8\"" << cppdb::exec;

About

CppCMS is a web development framework for performance demanding applications.

Support This Project

SourceForge.net Logo

Поддержать проект

CppCMS needs You


Navigation

Main Page


Valid CSS | Valid XHTML 1.0