diff --git a/application/config/application.php b/application/config/application.php index efe0b20a..adc39017 100644 --- a/application/config/application.php +++ b/application/config/application.php @@ -29,6 +29,18 @@ 'language' => 'en', + /* + |-------------------------------------------------------------------------- + | Application Character Encoding + |-------------------------------------------------------------------------- + | + | This default character encoding used by your application. This is the + | character encoding that will be used by the Str, Text, and Form classes. + | + */ + + 'encoding' => 'UTF-8', + /* |-------------------------------------------------------------------------- | Application Timezone diff --git a/system/form.php b/system/form.php index ddbe2b5c..b596216c 100644 --- a/system/form.php +++ b/system/form.php @@ -22,12 +22,12 @@ public static function open($action = null, $method = 'POST', $attributes = arra $action = URL::to($action); - $attributes['action'] = $action; + $attributes['action'] = HTML::entities($action); $attributes['method'] = ($method == 'GET' or $method == 'POST') ? $method : 'POST'; if ( ! array_key_exists('accept-charset', $attributes)) { - $attributes['accept-charset'] = 'UTF-8'; + $attributes['accept-charset'] = Config::get('application.encoding'); } $html = '