Password with £ when using security add-generic-password / find-generic-password
As a workaround, I now encode and decode to base64:
security add-generic-password -a username -s "test" -w $(echo "abc£" | base64) -U
security find-generic-password -a username -s "test" -w | base64 --decode
I have today hit the same issue, I found the solution from the hint @gordon-davisson gave you. Here I create a password with a £ in it, try to retrieve it, get hex, then decode with xxd:
$ security add-generic-password -a Rumbles -s "Rumbles-Secret" -T /usr/bin/security -U
$ security add-generic-password -a Rumbles -s "Rumbles-Secret" -w "British£Password" -U
$ security find-generic-password -a Rumbles -s "Rumbles-Secret" -w
42726974697368c2a350617373776f7264
$ security find-generic-password -a Rumbles -s "Rumbles-Secret" -w | xxd -p -r
British£Password%
Using xxd you can decode the hex in to a string, but to tidy it up you would also want to strip the trailing %:
security find-generic-password -a Rumbles -s "Rumbles-Secret" -w | xxd -p -r | rev | cut -c 1- | rev
British£Password
There may be other ways, I couldn't think of one without setting a variable...