symfony/symfony — pull request #4115 by Dattaya (2012-04-25 17:54:21+00:00)
Title: [Form] Trim listener, unicode whitespace characters.

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/Dattaya/symfony.png?branch=form/trim_listener)](http://travis-ci.org/Dattaya/symfony)
Fixes the following tickets: -
Todo:

I have some questions. ZERO WIDTH SPACE (200B) doesn't belong to White_Space but it's invisible and treated as white space by the html4.1 spec - http://www.w3.org/TR/html4/struct/text.html#h-9.1
Same question for
* U+202F	NARROW NO-BREAK SPACE
* U+FEFF	ZERO WIDTH NO-BREAK SPACE

Next, is it enough to check `kernel.charset` only without `mb_check_encoding($data, 'UTF-8')`? I'm asking because it's possible to send form encoded differently: `