Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^16: Native newline encoding

by sauoq (Abbot)
on May 29, 2012 at 01:23 UTC ( #972896=note: print w/ replies, xml ) Need Help??


in reply to Re^15: Native newline encoding
in thread Native newline encoding

And when ftping XML documents, it is normal to do so in using the ftp ascii mode so that the embedded newlines are handled correctly for cross-platform transfers.

Instead, you should transfer in binary and then just choose an editor that can handle the encoding properly for you.

hth

-sauoq
"My two cents aren't worth a dime.";


Comment on Re^16: Native newline encoding
Re^17: Native newline encoding
by BrowserUk (Pope) on May 29, 2012 at 03:55 UTC

    Should!? Edicts!

    Binary!? But its exactly what ascii mode was designed for.

    An editor!? Not much good for automated processing.

    hth. Not so much.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Binary!? But its exactly what ascii mode was designed for.

      Errr... wrong. And badly so. You might look at how you just referred to the mode yourself. Congrats on not using ambiguous words like "text."

      An editor!? Not much good for automated processing.

      Use tools that are encoding aware, if you prefer a more general statement. But then, most tools for processing XML are... the problems usually arise when someone opens an XML file in an editor.

      The point is: don't use FTP to to transfer XML files in ASCII mode as they may or not be ASCII encoded.

      -sauoq
      "My two cents aren't worth a dime.";
        The point is: don't use FTP to to transfer XML files in ASCII mode as they may or not be ASCII encoded.

        You really don't have a clue do you.

        Let's posit a scenario. There is an XML file on a z/OS system that you need to transfer to your *nix system. The only access available is ftp. You do the transfer in binary mode and what do you end up with? Utter garbage! Because it is encoded in UTF-EBCDIC and is now totally unintelligible.

        The point of ASCII mode, is that the source encodes the data into a known format: "8-bit NVT-ASCII". At the destination, that format is then converted to whatever local format is required. The point of this is that each system only needs to know how to convert from its local format and the "well-known format".

        I'll gift you a hint. Under ASCII mode, if the source file is not actually ASCII encoded, the ftp protocol requires that it be converted to ASCII -- or, in this era of unicode, an "ASCII compatible format" like UTF-8 -- for transmission.

        If the source file is in EBCDIC, the it is converted to ASCII (or an ASCII compatible) format.

        If the source file is in UTF-EBCDIC, then it is converted to ASCII (or an ASCII compatible) format.

        Seeing the pattern yet?

        Go away, and read the RFC -- I mean actually read it -- and then just stay stum.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://972896]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-07-13 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (246 votes), past polls