
Comparing changes: https://github.com/smarty-php/smarty/compare/v4.3.1...v4.4.1 It is noticeable that Smarty 4.3.1 does not officially support PHP 8.3. Is only supported with 4.4.0. Remark: During tests with Smarty 4.5.1, it was noticed that the following warning occurs: Deprecated: Using the unregistered function "function_exists" in a template is deprecated and will be removed in a future version. Use Smarty::registerPlugin to explicitly register a custom modifier. As of Smarty 5.X.X, templates must be revised again. The Smarty release 5.0.2 is already officially available. However, integration into FlatPress is not entirely trivial.
1.5 KiB
Charset Encoding
Charset Encoding
There are a variety of encodings for textual data, ISO-8859-1 (Latin1)
and UTF-8 being the most popular. Unless you change Smarty::$_CHARSET
,
Smarty recognizes UTF-8
as the internal charset if
Multibyte String is available,
ISO-8859-1
if not.
Note
ISO-8859-1
has been PHP's default internal charset since the beginning. Unicode has been evolving since 1991. Since then it has become the one charset to conquer them all, as it is capable of encoding most of the known characters even across different character systems (latin, cyrillic, japanese, ...).UTF-8
is unicode's most used encoding, as it allows referencing the thousands of character with the smallest size overhead possible.Since unicode and UTF-8 are very wide spread nowadays, their use is strongly encouraged.
Note
Smarty's internals and core plugins are truly UTF-8 compatible since Smarty 3.1. To achieve unicode compatibility, the Multibyte String PECL is required. Unless your PHP environment offers this package, Smarty will not be able to offer full-scale UTF-8 compatibility.
// use japanese character encoding
if (function_exists('mb_internal_charset')) {
mb_internal_charset('EUC-JP');
}
require_once 'libs/Smarty.class.php';
Smarty::$_CHARSET = 'EUC-JP';
$smarty = new Smarty();