I think tachyon's solution looks good.
Michael
In reply to Re^2: Portable way to extract string from a binary by mpeppler in thread Portable way to extract string from a binary by mpeppler