Email field rewrites international characters in email domain. How to avoid?

When a user enters an email address with an international domain, the entry is saved as the translated IDN.

Ex:
Submitted email: abc@æ.dk
Saved entry email: abc@xn–6ca.dk

How can we avoid this, so GF saves emails as they are entered?

Thanks for your time.

Gravity Forms doesn’t perform any changes to the values entered into Email fields. So there must be something else doing that in your site. Try doing a full conflict test.

Hi Samuel, thanks for your reply.

I was having the same issue on other client sites of ours, so i did a full conflict test which passed on all sites.

So i setup a fresh Wordpress v5.8.2 site (lang: English U.S.) with Gravity Forms Pro v2.5.15 as the ONLY plugin.

The issue persists - email addresses with an international domain name are saved as the translated IDN.

Could this be a WP core issue? (or “feature”)?

Thanks for your time.

I tried two different WordPress default installations, one with PHP 8.0.14 and another with PHP 7.4.3, and in both cases I can’t even submit a form using abc@æ.dk as it’s not accepted as a valid email address: Screenshot aby1isODRw.png - Droplr

This is expected because email addresses are validated by WordPress, specifically the is_email function, which doesn’t accept i18n domains as you can read on the documentation for this function linked above.

WordPress does include a filter in that function so the result can be overridden by a custom function added to theme and/or plugins.

So if you don’t have any third-party plugin enabled and you’re using a default WordPress theme without custom functions (e.g. Twenty Twenty-One).

I would think about something at the host side of things (e.g. PHP version or setup related), or even something in your browser doing the domain conversion.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.