3.1.5.4.2 IdnToUnicode

 COMMENT IdnToUnicode
 COMMENT  On Entry:  SourceString – Idn String to get Unicode
 COMMENT                            representation of.
 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  IDN_USE_STD3_ASCII_RULES: Enforce validation of the STD3
 COMMENT                            characters.
 COMMENT  IDN_RAW_PUNYCODE:         Only decode the punycode, no additional
 COMMENT                            validation.
 COMMENT  IDN_EMAIL_ADDRESS:        Allow punycode encoding of the local part
 COMMENT                            of an email address to tunnel EAI
 COMMENT                            addresses through non-Unicode slots.
 COMMENT
 COMMENT  On Exit:  UnicodeString - String containing the Unicode form of the
 COMMENT                            input string.
 PROCEDURE IdnToUnicode (IN SourceString : Punycode String,
                         IN Flags: 32 bit integer,
                         OUT UnicodeString : Unicode String)
 UnicodeString = PunycodeDecode(SourceString)
  
 COMMENT IDN_RAW_PUNYCODE stops here
 IF (IDN_RAW_PUNYCODE bit is on in Flags) THEN
     return UnicodeString
 ENDIF
 COMMENT Otherwise verify that the result round trips
 RoundTripPunycodeString = IdnToAscii(UnicodeString, Flags)
 IF (RoundTripPunycodeString IS NOT EQUAL TO UnicodeString)
     return ERROR
 ENDIF
 return UnicodeString