in reply to DBI returns NULL characters in string
with:@test = split (//,$something); foreach (@test) {print "$_\n";}
Given the input "J\x00O\x00H\x00N\x00" this will print:for (split //, $something) { printf "%02X ", ord; }
With that said, as far as I can tell, if your string contains embedded NULLs, your browser should interpret them as whitespace, so that it appears that there is a single space where each NULL character would be expected to appear. This would render your example as: J O H N4A 00 4F 00 48 00 4E 00
If you're not seeing this behavior when interfacing with the CGI, but you are seeing it in the shell, you should probably do some testing to find out if the mystery characters show up in both environments. If not, then there's a problem with the environment in which your script is running (when running from the shell).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DBI returns NULL characters in string
by jcbyrne (Acolyte) on Apr 24, 2001 at 22:52 UTC | |
by converter (Priest) on Apr 24, 2001 at 23:17 UTC | |
by Anonymous Monk on Apr 26, 2001 at 22:03 UTC |