[TYPO3-core] RFC: garbage characters are shown if form validation fails

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Feb 21 11:14:58 CET 2007


Dmitry Dulepov schrieb:
> Hi!
> 
> This is SVN patch request.
> 
> Branches: all
> 
> BT ref: http://bugs.typo3.org/view.php?id=3527
> 
> Problem: if mailform contains non-latin1 characters in field names and 
> JS validation fails for the form, JS message shows field names 
> incorrectly (garbage instead of normal characters).
> 
> Solution: see the attached patch. Patch is not made by me but I tested 
> it and it fixes the issue. Also many people confirmed it in 
> corresponding bug report.

The solution uses decodeURI which is a) not available on older browser and 
b) relies on UTF8 input data (as URLs must be UTF8 encoded).

So if we don't care about older browsers we can ensure that the data passed 
from PHP to JS in such a way is ecnoded in UTF8. Please have a look at th 
maling archive for some posts of mine on this topic.

Masi

PS: I think that decodeURIcomponent is what should be used.


More information about the TYPO3-team-core mailing list