cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

null character not displaying

aleslie
1-Newbie

null character not displaying

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
bibach
1-Newbie
(To:aleslie)

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 🙂
Top Tags