in reply to Re: Convert binary file to ascii
in thread Convert binary file to ascii

There is a problem I am running into, and that is that if there is a byte with the value "0a" in the binary file, it is not making it through the conversion process above. I guess something thinks it is a newline. Any idea on how to address that?

Edit: Upon reading ikegami's reply above, this may have to do with the field record separator, which I just learned about from ikegami's post, i.e. $/.

Replies are listed 'Best First'.
Re^3: Convert binary file to ascii
by BrowserUk (Patriarch) on Jun 22, 2007 at 19:42 UTC

    That makes no sense. Nothing in the snippet I posted will care, or even notice whether there is an '0a' character in the data it is processing.

    The only time characters get 'converted' is of the file is read with CRLF translation in effect, which it won't be if you have binmoded the file as you did in the OP (and as I mentioned above.


    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.
      I am using binmode as in the OP, but I am seeing some strange behavior. With one of my input files it did skip "0a" bytes. I created a new test file with some "0a" bytes, but with this file it worked correctly, not skipping the "0a" bytes as you suggested. I am doing more investigation to see what's really going on.