in reply to apostrophes and security
I had a not disimilar task myself here.
Note the points made about the character range x80-x9F.
Hope this helps,
John