3.1.5.4.7 IDNA2003 NormalizeForIdna

NormalizeForIdna prepares the input string for encoding, using the mapping/normalization rules provided by IDNA2003.<16>

 COMMENT NormalizeForIdna2003
 COMMENT  On Entry:  SourceString – Unicode String to prepare for IDNA
 COMMENT             Flags        - Bit flags to control behavior
 COMMENT                            of IDN validation
 COMMENT
 COMMENT  IDN_ALLOW_UNASSIGNED:     During validation, allow unicode
 COMMENT                            code points that are not assigned.   
 COMMENT
 COMMENT  On Exit:  Punycode      - String containing the Punycode ASCII range
 COMMENT                            form of the input
 PROCEDURE NormalizeForIdna2003 (IN SourceString : Unicode String,
                                 IN Flags: 32 bit integer,
                                 OUT OutputString : Unicode String)
  
 COMMENT Behavior is identical to the results of RFC 3491 (http://tools.ietf.org/html/rfc3491 )
 COMMENT Make sure to allow unassigned code points if IDN_ALLOW_UNASSIGNED bit is set in Flags
 SET OutputString TO ApplyRfc3491(SourceString, Flags)
  
 RETURN OutputString