original_string: public function encodeString(string $address): string
      {
          $i = strrpos($address, '@');
          if (false !== $i) {
              $local = substr($address, 0, $i);
              $domain = substr($address, $i + 1);
  
              if (preg_match('/[^\x00-\x7F]/', $local)) {
                  throw new AddressEncoderException(sprintf('Non-ASCII characters not supported in local-part os "%s".', $address));
              }
  
              if (preg_match('/[^\x00-\x7F]/', $domain)) {
                  $address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46));
              }
          }
  
          return $address;
      }
code: public function encodeString(string $address): string
      {
          $i = strrpos($address, '@');
          if (false !== $i) {
              $local = substr($address, 0, $i);
              $domain = substr($address, $i + 1);
  
              if (preg_match('/[^\x00-\x7F]/', $local)) {
                  throw new AddressEncoderException(sprintf('Non-ASCII characters not supported in local-part os "%s".', $address));
              }
  
              if (preg_match('/[^\x00-\x7F]/', $domain)) {
                  $address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46));
              }
          }
  
          return $address;
      }
code_tokens: public function encodeString ( string $ address ) : string { $ i = strrpos ( $ address , '@' ) ; if ( false !== $ i ) { $ local = substr ( $ address , 0 , $ i ) ; $ domain = substr ( $ address , $ i + 1 ) ; if ( preg_match ( '/[^\x00-\x7F]/' , $ local ) ) { throw new AddressEncoderException ( sprintf ( 'Non-ASCII characters not supported in local-part os "%s".' , $ address ) ) ; } if ( preg_match ( '/[^\x00-\x7F]/' , $ domain ) ) { $ address = sprintf ( '%s@%s' , $ local , idn_to_ascii ( $ domain , 0 , INTL_IDNA_VARIANT_UTS46 ) ) ; } } return $ address ; }
docstring: Encodes the domain part of an address using IDN.
  
  @throws AddressEncoderException If local-part contains non-ASCII characters
docstring_tokens: Encodes the domain part of an address using IDN .