Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16016

Encoding special characters via UnsafeUriCharactersEncoder does not work in all cases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Bug
    • 2.20.4, 3.8.0
    • 3.8.0
    • camel-core
    • None
    • Unknown

    Description

      we have the following FTP password:

      String password= "%j#7%c6i";

      when encoded with camel (we are using RAW()) this results in a gibberish string with <?> (unprintable characters)

      ==> expected output:

      %25j%237%25c6i

      Sample test demonstrating the bug / reproducer:

      @Test
      public void testWrongEncoding(){
         String password= "%j#7%c6i";
         String result = UnsafeUriCharactersEncoder.encode(password);
         String expected = "%25j%237%25c6i";
         System.out.println("expected ->  "+expected);
         System.out.println("vs");
         System.out.println(result);
         if (!result.equals(expected)){
            System.err.println("not the same , no no ");
         }
      
      }
      

       

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              koszta Pavel Kostelnik
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: