public static String normalizeUri(String uri) throws URISyntaxException {
        // try to parse using the simpler and faster Camel URI parser
        String[] parts = CamelURIParser.fastParseUri(uri);
        if (parts != null) {
            // we optimized specially if an empty array is returned
            if (parts == URI_ALREADY_NORMALIZED) {
                return uri;
            }
            // use the faster and more simple normalizer
            return doFastNormalizeUri(parts);
        } else {
            // use the legacy normalizer as the uri is complex and may have unsafe URL characters
            return doComplexNormalizeUri(uri);
        }
    }
@Test
    public void testRawParameter() throws Exception {
        String out = URISupport.normalizeUri(
                "xmpp://camel-user@localhost:123/test-user@localhost?password=RAW(++?w0rd)&serviceName=some chat");
        assertEquals("xmpp://camel-user@localhost:123/test-user@localhost?password=RAW(++?w0rd)&serviceName=some+chat", out);

        String out2 = URISupport.normalizeUri(
                "xmpp://camel-user@localhost:123/test-user@localhost?password=RAW(foo %% bar)&serviceName=some chat");
        // Just make sure the RAW parameter can be resolved rightly, we need to replace the % into %25
        assertEquals("xmpp://camel-user@localhost:123/test-user@localhost?password=RAW(foo %25%25 bar)&serviceName=some+chat",
                out2);
    }