in reply to readlink returning strange stuff

NUL (^@) marks the end of a C string, so it looks like the system is placing extra "hidden" information in the symlink. s/\0.*// should clear that up for you.