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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

null character not displaying

aleslie
1-Visitor

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-Visitor
(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 🙂
Announcements

Top Tags