1 2 Previous Next 19 Replies Latest reply: Sep 4, 2013 4:48 AM by FouadAzem Go to original post RSS
      • 15. Re: most unique delimiter between key and value.
        FouadAzem

        Hi,

         

        this escaping mechanisim won't help me in the parsing issue , the input could be everything and i need to keep what was inserted as input.

         

        in case the user insert \" i can't diplayed as " or input was \\ i can't show it as \.

         

        user can insert \\\" , \\ or \" i need to dispalyed the same as it was inserted.

         

        this is my big issue with using the escaping mechanisim during the parsing and working base on the rules specified above.

        • 16. Re: most unique delimiter between key and value.
          rp0428

          this escaping mechanisim won't help me in the parsing issue , the input could be everything and i need to keep what was inserted as input.

          And that is EXACTLY what the escaping mechanism is designed to do.

          in case the user insert \" i can't diplayed as " or input was \\ i can't show it as \.

           

          user can insert \\\" , \\ or \" i need to dispalyed the same as it was inserted.

          No one has aked you to 'show it' differently than it was entered.

           

          1. The user provides some input

          2. The parser uses the rules to 'escape' the input as needed

          3. The 'parsed and escaped' input is then stored.

           

          When you want to retrieve the data for the user

           

          1. You query the 'parsed and escaped' data which was stored

          2. You 'unparse' and 'unescape' the data to  obtain the original input

          3. You deliver that original input to the user.

          • 17. Re: most unique delimiter between key and value.
            FouadAzem

            examples.

             

             

            example1:-

             

            StringEscapeUtils.unescapeJava

             

            After conversion Escape :\\+bla\\\\+

             

            After conversion Escape Unescape :\+bla\\+

             

             

             

            \+bla\\+ it's not the orignal. the original is \\+bla\\\\+.

             

             

            example 2:-

             

             

            String escaped = StringEscapeUtils
               
            .escapeCsv("I said \"Hey, I am 5'10\".\""); // I said "Hey, I am 5'10"."

            System.out.println(escaped); // "I said ""Hey, I am 5'10""."""

            It is also possible to invert the way for recover the original string:

            String unescaped = StringEscapeUtils .unescapeCsv("\"I said \"\"Hey, I am 5'10\"\".\"\"\""); // "I said ""Hey, I am 5'10""."""  System.out.println(unescaped); // I said "Hey, I am 5'10"."

             

             

            bottom Line, there is character which the user input like \\ and \" which will be changed as \ and " which is not base the user input expectation after escape and unescape.

             

            the same as \\\\ , which is appear \\ after escape and unescape.

            • 18. Re: most unique delimiter between key and value.
              rp0428

              Those examples are not relevant if your use case isn't the same as what that code is based on.

               

              1. You now have the rules.

              2. You have working Java class files that implement those rules for a defined set of delimiters and data types

              3. You have the Java source code for those class files so you can see exactly how the rules are applied and how the specific delimiters and data types affect the process.

               

              It is now up to YOU to determine if that existing code will do what you need and, if not, to modify that code (or write your own) that implements the rules for your use case.

               

              You have all of the information you need to do the job. No one on the forum, certainly not me, is going to write your code for you. If you can't get the job done when you have ALL of the information needed then you will need to hire a consultant to do it.

               

              No other help is possible.


              • 19. Re: most unique delimiter between key and value.
                FouadAzem

                Thanks alot to you Guru

                1 2 Previous Next