Title: punycode / IDNA converter
Last modified: August 21, 2016

---

# punycode / IDNA converter

 *  Resolved [AliceWonderFull](https://wordpress.org/support/users/alicewonderfull/)
 * (@alicewonderfull)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/punycode-idna-converter/)
 * Does WordPress already have the facilities for switching between punycode and
   IDNA?
 * [http://www.phpclasses.org/browse/file/5845.html](http://www.phpclasses.org/browse/file/5845.html)
 * is a pretty good class I have used in the past, I am hesitant to include it with
   my plugin especially if the issue is already addressed in WordPress, but also
   because if the issue is not addressed then I would rather advocate for the issue
   being officially addressed. Maybe even by including that class (it is GPL2.1)

Viewing 1 replies (of 1 total)

 *  Thread Starter [AliceWonderFull](https://wordpress.org/support/users/alicewonderfull/)
 * (@alicewonderfull)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/punycode-idna-converter/#post-4374475)
 * Resolved, with the appropriate version of php this can be done with PECL modules.
 *     ```
       function smartAvaIDN2Puny($domain) {
       	if(function_exists('idn_to_ascii')) {
       		$domain=idn_to_ascii($domain);
       		}
       	return($domain);
       	}
   
       function smartAvaPuny2IDN($domain) {
       	if(function_exists('idn_to_utf8')) {
       		$domain=idn_to_utf8($domain);
       		}
       	return($domain);
       	}
       ```
   
 * works for me. Well, the PECL modules (idn and intl) have some known bugs that
   cause certain IDNs not to work but those will get fixed and using binary PECL
   modules is probably a better solution than using the class.

Viewing 1 replies (of 1 total)

The topic ‘punycode / IDNA converter’ is closed to new replies.

## Tags

 * [punycode](https://wordpress.org/support/topic-tag/punycode/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [AliceWonderFull](https://wordpress.org/support/users/alicewonderfull/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/punycode-idna-converter/#post-4374475)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
