ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Extra CRLF in stream file

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

  • Extra CRLF in stream file

    I copied an Apache-Tomcat log file from my Windows 2008 R2 server to the iSeries by doing a drag/drop into the directory tree of System i Navigator. The log file contains XML data where the "<" has been converted to %3C and the ">" to %3E. During the copy, the "%" signs were pre-ppended with a x'0D', giving me lots of extra (and erroneous) CRLF's.

    Is there a way I can get the percent signs to be percent signs and not line-feeds?

    Thanks.

  • #2
    System i Netserver can perform character encoding conversions when you move files through it to/from another platform. What is the CCSID of the file after it was copied into the server directory?
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment


    • #3
      The CCSID is 1252.

      I tried it a different way with the same result. I was using a remote desktop connection to gain access to the file. I copied the file to my c: drive, which was available on the remote PC. I then copied the file from my c: drive to the IFS using a mapped network drive. Same CCSID, same '%' pre-pended with a x'0d'.

      Comment


      • #4
        Its very strange to me that it'd escape things as %3C, which is something I've only seen in HTTP url encoding. Since your data is a file, why on earth would it want to URL encode it? This really would only make sense if it was part of a web form, and would be a bug that it's not decoding it on the other end.

        Comment


        • #5
          The file is an Apache Tomcat log of transactions in XML format sent from a "storefront" website. I am trying to transfer them to the IBM i for display and analysis.

          Comment


          • #6
            Ah, I see. So most likely the data is already encoded -- that's the format that Tomcat is getting, and its just writing it to the log file that way. So the changes in the data aren't due to CCSID or file transfer conversion, that's just the way they are. Nothing, really, to do with the IFS.

            What programming language are you working in?

            Comment


            • #7
              An example of data in the log file on the PC is "%3Crequest+name%3D ". The "+" is also part of the URL encoding. This string becomes "0D0A3Crequest+name0D0A3D" when transferred to the IFS. The quotes are not part of the data.

              Comment

              Working...
              X