Skip to main content
1-Visitor
June 29, 2010
Question

null character not displaying

  • June 29, 2010
  • 1 reply
  • 679 views

I am building an ascii data stream and writing it out to a text file.

Each line of text needs to be terminated with the null character which I am appending to within the ACL via :
text_line=string . chr(0);

When I open the text file in Notepad++, and view symbols it is not displaying the NUL symbol; Other ascii symbols appear ok.

Am I using the correct ACL syntax ? Do I need to provide an extra parameter when writing out to the file ?

Regards,

Andy

    1 reply

    1-Visitor
    June 29, 2010
    On Tue, Jun 29, 2010 at 5:43 AM, Andy Leslie
    <info@structuredinformation.co.uk> wrote:
    > I am building an ascii data stream and writing it out to a text file.
    >
    > Each line of text needs to be terminated with the null character which I am
    > appending to within the ACL via :
    > text_line=string . chr(0);
    >
    > When I open the text file in Notepad++, and view symbols it is not
    > displaying the NUL symbol; Other ascii symbols appear ok.
    >
    > Am I using the correct ACL syntax ? Do I need to provide an extra parameter
    > when writing out to the file ?

    Try building your string like this:

    text_line = pack("a*x", string)

    Also, make sure you include a "b" in the string for the "access"
    parameter to the open() function and use the write() function to write
    the data to the file.

    -Brandon 🙂