diff --git a/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php b/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php
index 63a2be151b..65d51f4773 100644
--- a/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php
+++ b/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php
@@ -97,7 +97,7 @@ class CodeExtension extends \Twig_Extension
} elseif ('array' === $item[0]) {
$formattedValue = sprintf("array(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
} elseif ('string' === $item[0]) {
- $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset()));
+ $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->charset));
} elseif ('null' === $item[0]) {
$formattedValue = 'null';
} elseif ('boolean' === $item[0]) {
@@ -105,7 +105,7 @@ class CodeExtension extends \Twig_Extension
} elseif ('resource' === $item[0]) {
$formattedValue = 'resource';
} else {
- $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES, $this->getCharset()), true));
+ $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES, $this->charset), true));
}
$result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);