[Typo3-dev] RFC: Bug #277: utf-8 + JSMENU/feAdminLib

Bernhard Kraft kraftb at kraftb.at
Fri Oct 21 04:36:11 CEST 2005


Andreas Schwarzkopf wrote:
> Hi Bernard,
> 
> I think some major part of this problem is not addressed in your 
> solution yet, it is more than only the alert problem.
> 
> An example situation:
> - site with utf-8 charset
> - forms with preview, based on feAdminLib.inc
> - user with any modern browser, e.g. firefox 1 or IE 6.0
> 
> In this situation all non-ASCII chars entered by the user will be 
> corrupted when they are stored to the database, because of this obsolete 
> js function unescape.

You are not completly right. In fact utf-8 data entered into forms get's sent as valid utf-8 directly from the
form to the server. This part works perfectly.

I guess you address the issue that you have for example a FE-User registration form with a preview. You fill out
the form. Click "Preview" but have not filled out the form correctly. You will get to the same page again but special
characters are converted to garbage now.

The proble with this procedure is not that the fields can't get transfered correctly to the server but rather that
the new form which gets generated has code to fill in the values of the fields. This code which fills in the fields
is the code in question. An example is:

updateForm('fe_users_form','FE[fe_users][username]',unescape('kraftb%C3%A3%C2%B6z%C3%A3%C2%BC'))

which set's the username of the field. And my solution would be to change T3 code so it generates this line like:

updateForm('fe_users_form','FE[fe_users][username]', 'kraftbözü')

notice the special characters "ö ü" in the string. Old browser wouldn't have accepted them but modern do.


greets,
Bernhard




More information about the TYPO3-dev mailing list