[Typo3-dev] Improvement of function validEmail($email)

Martin T. Kutschker Martin.T.Kutschker at blackbox.net
Tue Mar 9 11:06:29 CET 2004


Michael Stucki wrote:
> Martin T. Kutschker wrote:
> 
>>Hm?? You mean a lttle code that translates umlauts in iso-8859-1, utf.8,
>>etc in the IDN encoding?
> 
> It just translates the domain name part of an address:
> 
> $mailaddress = müller at müllermilch.de;
> $mailaddress = convertToIDN($mailaddress);
> echo $mailaddress;
> 
> This wrapper would return 'müller at xn--mller-kva.de' in our case.

That's what I meant. I was referring to iso-8859-1, utf-8 because your 
little routine will have to know the encoding to make the trabnslation. 
ü is a single byte in iso-8859-1, but two bytes in utf-8, etc

> Unfortunately this translation looks to be a difficult thing! There's a
> class in the PHPclasses repository that does the conversion but it's not
> licensed as GPL. Don't know if this could ever be included:
> http://www.phpclasses.org/browse/package/1509.html

I can't look at the code, you need a subscription.

> Maybe it's better to wait until PHP adds native support for all kinds of IDN
> operations.

This won't do for older systems.

>>>Don't forget that umlauts in the localpart of an address have ever been
>>>valid!
> 
> 
>>I though you'd had to quote them to be valid: "müller"@miclh.de. Or was
>>it escaping?
> 
> I'm not sure, but I think this is not needed. Does anybody know?

"Needed" in the sense, you don't need to escape? Or no need to support 
it in Typo3?

Anyway the original SMTP restricted itself to 7bit, so umlauts are a 
scary thing. And again arises the probem of the encoding (charatcer 
set). iso-8859-1? utf-8? Something else?

Masi





More information about the TYPO3-dev mailing list