in reply to Re^2: Weird characters' issue
in thread Weird characters' issue

I use s/\0+//g right now and it seems to work fine. Where do I get those strings? They come on the socket I am listening to. String are generated by a phone switch. NULL characters are always added whenever the date is inserted in a string like in the example bellow:
120507 1324 01300 6417 13639820545 801<CR +><LF>13:24 12/05<CR><LF>^@^@^@13:24 12/05<CR><LF>^@^@^@120507 1324 00 +456 2867416007 808 14972681971 801<CR><LF>13:24 12 +/05<CR><LF>^@^@^@
I don't see any other places with those characters (not in the data I am capturing, or anywhere else), only when the timestamp is added in string. I guess it is safe to use s/\0+//g in this case, am I right?

Replies are listed 'Best First'.
Re^4: Weird characters' issue
by ikegami (Patriarch) on Dec 07, 2007 at 16:01 UTC
    I guess so. There's no obvious reason for them to be there. They truly appear to be junk.