Skip to content

Commit

Permalink
Replaced outdated references to SMARTY_RESOURCE_CHAR_SET in docs with…
Browse files Browse the repository at this point in the history
… Smarty::$_CHARSET.
  • Loading branch information
wisskid committed Jun 15, 2022
1 parent 6295044 commit f8e1ba7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/programmers/api-variables/variable-escape-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Setting `$escape_html` to TRUE will escape all template variable output
by wrapping it in
`htmlspecialchars({$output}, ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET);`,
`htmlspecialchars({$output}, ENT_QUOTES, $char_set);`,
which is the same as `{$variable|escape:"html"}`.

Template designers can choose to selectively disable this feature by
Expand Down
11 changes: 6 additions & 5 deletions docs/programmers/charset.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ 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 specified otherwise with the
`SMARTY_RESOURCE_CHAR_SET` constant, Smarty recognizes `UTF-8` as the
internal charset if [Multibyte String](https://www.php.net/mbstring) is
available, `ISO-8859-1` if not.
and UTF-8 being the most popular. Unless you change `Smarty::$_CHARSET`,
Smarty recognizes `UTF-8` as the internal charset if
[Multibyte String](https://www.php.net/mbstring) is available,
`ISO-8859-1` if not.

> **Note**
>
Expand Down Expand Up @@ -36,8 +36,9 @@ available, `ISO-8859-1` if not.
if (function_exists('mb_internal_charset')) {
mb_internal_charset('EUC-JP');
}
define('SMARTY_RESOURCE_CHAR_SET', 'EUC-JP');

require_once 'libs/Smarty.class.php';
Smarty::$_CHARSET = 'EUC-JP';
$smarty = new Smarty();

0 comments on commit f8e1ba7

Please sign in to comment.