Yes, that does look like plain ASCII* (please use <code> tags next time, and consider registering an account so you can edit posts).

So the problem is less likely to be on the input end, but you also haven't shown us any code. I think we need to take a step back here - please see Short, Self-Contained, Correct Example and post the shortest piece of code possible that still reproduces the issue, some short sample input data, the output data corresponding to that input which shows the problem (a hex dump might be best to see the null bytes, or at least the output of Data::Dump), and the output that you actually want to get for that input. More advice in How do I post a question effectively? and I know what I mean. Why don't you?

* Update: I missed it earlier, but the AM post is correct that if you have bytes above 0x7f, then it's not plain ASCII. If Encode::Guess is guessing ASCII, and you used my example code, then probably the buffer size was not big enough. When I said "Can you show us?", I actually meant that part of the file which contains bytes above 0x7f.


In reply to Re^4: Parsing issue (updated) by haukex
in thread Parsing issue (null bytes?) by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.