Exactly what is the "long standing and nasty problem"? If my theory about ' being a problem is right (and I did get past this problem when I omitted it), a stop gap would be to tell people not to use that character in their password. It does seem odd that the \' isn't working to quote it.
Ross P.S. For some reason I don't seem to have gotten the email with Paul's response.