Development

#1926 (Using charset iso-8859-2 in settings.yml generates warnings)

You must first sign up to be able to contribute.

Ticket #1926 (closed defect: fixed)

Opened 1 year ago

Last modified 4 months ago

Using charset iso-8859-2 in settings.yml generates warnings

Reported by: Fabian.Tamas.Laszlo Assigned to: fabien
Priority: major Milestone: 1.1.0
Component: view Version: 1.0.5
Keywords: iso-8859-2, escaping Cc:
Qualification: Design decision

Description

Symfony escapes variables and metas using htmlentities. This standard PHP function doesn't know anything about iso-8859-2. When Symfony tries to escape things using this charset htmlentities gives a warning:

Warning: htmlentities() [function.htmlentities]: charset `iso-8859-2' not supported, assuming iso-8859-1 in /usr/share/php/symfony/config/sfViewConfigHandler.class.php on line 229

My opinion (along with Alexey.Kirpichnikov: #401) is to use htmlspecialchars instead of htmlentities.

htmlentities breaks some of the hungarian characters: ű, ő, Ű, and Ő.

htmlspecialchars generates the same warning, but this can safely be ignored, because it only deals with ", ', <, and >. These characters are the same in many codepages. It doesn't touch anything else. Therefore with this fix Symfony would provide better support for different character encodings.

A more clean solution would be adding a custom escaping functionality to Symfony, say letting the user to declare his/her own output/meta escaping function.

Change History

09/10/07 18:40:01 changed by gregoire

  • owner changed from fabien to gregoire.
  • qualification set to Unreviewed.
  • milestone set to 1.0.8.

10/02/07 19:00:31 changed by noel

  • qualification set to Unreviewed.
  • milestone deleted.

Need to be discussed and more tested.

02/08/08 23:04:45 changed by dwhittle

  • qualification changed from Unreviewed to Design decision.

02/08/08 23:04:50 changed by dwhittle

  • owner changed from gregoire to dwhittle.
  • status changed from new to assigned.

02/08/08 23:47:09 changed by dwhittle

  • owner changed from dwhittle to fabien.
  • status changed from assigned to new.

05/07/08 09:09:29 changed by FabianLange

  • keywords changed from iso-8859-2 to iso-8859-2, escaping.

this is bascially also affecting: #2860

I would like to add a +1 for using htmlspecialchars. Currently there is no way to prevent your utf-8 chars becoming entities. This is especially an issue as there are readers, search engines that prefer utf-8 chars rather than entities in metas.

06/23/08 02:58:19 changed by dwhittle

  • milestone set to 1.1.0 FINAL.

06/23/08 09:32:04 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone changed from 1.1.0 FINAL to 1.1.0.

symfony 1.1 now uses htmlspecialchars by default instead of htmlentities. In symfony 1.0, you can change the escaping strategy with the ESCAPING_STRATEGY setting (in settings.yml).