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

Encoding special characters via UnsafeUriCharactersEncoder does not work in all cases

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Bug
    • Affects Version/s: 2.20.4, 3.8.0
    • Fix Version/s: 3.8.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: