private String unescape ( String value ) { StringBuilder result = new StringBuilder ( ) ; for ( int i = 0 ; i < value . length ( ) ; ++ i ) { char c = value . charAt ( i ) ; if ( c == ESCAPE_PREFIX ) { String codeString = value . substring ( i + 1 , i + 3 ) ; int code = Integer . parseInt ( codeString , 16 ) ; if ( code < reservedChars . length && reservedChars [ code ] == code ) { result . append ( reservedChars [ code ] ) ; i += 2 ; } else { throw new ServiceLocationException ( "Unknown escaped character " + ESCAPE_PREFIX + codeString + " at position " + ( i + 1 ) + " of " + value , SLPError . PARSE_ERROR ) ; } } else { result . append ( c ) ; } } return result . toString ( ) ; }
Unescapes the scope string following RFC 2608 6 . 4 . 1