ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Conversion problem when reading encoded url

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Conversion problem when reading encoded url

    Hello,

    Im trying to read in an encrypted and base64 encoded url that contains:

    MsUoMDbN7pk6loNoqtBH%2bOf8A9WvV2YJPytgKA2KT8GOrj%2 bZGGhRGAK0PHa9m%2bKOAgQe%2bRCMqtD4Fkj6xUTbRHtnUe6n 3QZMwjkFACvErhw%3d


    But, when I read it in through CGIDEV2 it converts it to:

    MsUoMDbN7pk6loNoqtBH+Of8A9WvV2YJPytgKA2KT8GOrj+ZGG hRGAK0PHa9
    m+KOAgQe+RCMqtD4Fkj6xUTbRHtnUe6n3QZMwjkFACvErhw=


    Im then sending into a java decodeurl that is bombing.

    Is there any way to prevent the conversion from the url to the RPG alpha field

  • #2
    Re: Conversion problem when reading encoded url

    The CGIDEV2 routine is removing the URL-encoding... so you don't need to call 'decodeurl' because it's already decoded. That's a good thing, isn't it? Naturally, it's still base64-encoded, so you'll still have to do that part...

    If you don't want it to be decoded at all, then you don't need CGIDEV2, just get the raw value from the QUERY_STRING or stdin (depending on how the data was sent to you) and use it... but this would seem like an extremely weird thing to do, because surely you want to remove the URL encoding?!

    Comment


    • #3
      Re: Conversion problem when reading encoded url

      Darn, I thought that was the reason I was getting an ArrayStoreException :

      Message . . . . : Java exception received when calling Java method (C G D
      F).
      Cause . . . . . : RPG procedure MYPROG in program MYLIB/MYCLASS received
      Java exception "java.lang.ArrayStoreException:" when calling method
      "decrypt" with signature "(Ljava.lang.StringLjava.lang.String;" in class
      "myclassAES".

      I believe this is a conversion problem back to the i5, but I cant verify that. The i5 debugger is not the best java debugger in the world. You cant view the java variables.

      Comment

      Working...
      X