[Typo3-dev] URL-encode problem with mm-relations in the BE (UTF-8)

Martin Kutschker martin.kutschker at no5pam.blackbox.net
Mon Apr 11 18:57:45 CEST 2005


"Ingmar Schlecht" <ingmars at web.de> schrieb im Newsbeitrag 
news:mailman.1.1113233043.7345.typo3-dev at lists.netfielders.de...
> Hi Martin,
>
> Martin Kutschker wrote:
>> I think it has been posted before but couldn't find any message.
>>
>> I have an mm-field and UTF-8. The "items:"-field is displayed corretcly, 
>> but in the "selected:" field the elements are broken (all non-ASCII 
>> chars). It seems that the string values are converted one time too many 
>> with urlencode or a similiar function.
>
> I don't know how difficult this will be, but if you managed to write a 
> patch until tonight, you could send it to Kasper and directly commit it to 
> CVS as soon as you get his OK.

I have tracked it down, but I don't think I'll get a fix ready. I can tinker 
with it but wouldn't be aware of all the depending code.

So what's the issue?

t3lib_TCEforms->getSingleField_typeSelect_multiple uses $LANG->sL to display 
the options. But $LANG deals mainly with LL-files which have a specific 
character set (eg iso-8850-1 for German). So it does a conversion from the 
LL-charset ($LANG->origCharSet) to to outpu charset (in my case UTF-8).

BUT, this is of course wrong when the data does not originate from an 
LL-file. If it's a select with a foreign table than it may be any charset. 
When forceCharset is in effect it's clear that it's value must be honoured. 
If it is not set than perhaps the charset of the BE language may be a safe 
assumption.

I have been able to modify t3lib_TCEforms and language ($LANG) in such a way 
that a charset can be passed along. Forcing it (in my case) to UTF-8 worked 
well. But again there is a major BUT.

The point is that t3lib_TCEforms->getSingleField gets the row, but no 
charset info. In the case of an mm-select-field the data is 
"uid|urlecoded(label)". Sound and safe, but it doesn't allow us to unencode 
the label correctly (see above why).

I have no time to see where t3lib_TCEforms->getSingleField gets its values, 
but there must be made a change. Either it passes the charset along or it 
doesn't use urlencode.

Masi 






More information about the TYPO3-dev mailing list