Tolerate unicode strings as username and password

In case of unicode username and password values, just utf-8 encode them.
Here, the encoding shouldn't matter much.  All parties must agree
on encoding, but UTF-8 is fine.

Change-Id: Ia4a8a4fcbc5ea9b12ee45ebcc566abe4713b544a