by Bart Van Leeuwen.
I also had the problem that I could not use token.php to get a user token.. It appeared to be that I had a password for the user containing non-alphanumerical characters. This caused a UTF-8 problem.
In the settings I changed the requirement that a password must contain 1 non-alphanumeric character, so I could give the webservice user a alphabetic password. token.php worked OKE after that.