{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry/cli/issues/560","labels_url":"https://api.github.com/repos/cloudfoundry/cli/issues/560/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/cli/issues/560/comments","events_url":"https://api.github.com/repos/cloudfoundry/cli/issues/560/events","html_url":"https://github.com/cloudfoundry/cli/issues/560","id":103511572,"number":560,"title":"cf login fails with non-ascii password characters","user":{"login":"gberche-orange","id":4748380,"avatar_url":"https://avatars.githubusercontent.com/u/4748380?v=3","gravatar_id":"","url":"https://api.github.com/users/gberche-orange","html_url":"https://github.com/gberche-orange","followers_url":"https://api.github.com/users/gberche-orange/followers","following_url":"https://api.github.com/users/gberche-orange/following{/other_user}","gists_url":"https://api.github.com/users/gberche-orange/gists{/gist_id}","starred_url":"https://api.github.com/users/gberche-orange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberche-orange/subscriptions","organizations_url":"https://api.github.com/users/gberche-orange/orgs","repos_url":"https://api.github.com/users/gberche-orange/repos","events_url":"https://api.github.com/users/gberche-orange/events{/privacy}","received_events_url":"https://api.github.com/users/gberche-orange/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cloudfoundry/cli/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-27T13:39:19Z","updated_at":"2015-11-18T21:46:37Z","closed_at":null,"body":"Tested under windows 7, configured with french local with both MSDOS shell and cygwin, on both private cf instance and public pivotal.run.io\r\n\r\nWhen the password contains an accentuated character `é` in our case, the UAA rejects the login. However, web UIs such as run.pivotal.io properly accept the login with the accentuated characters, which makes me suspect there is something related to the way the CLI sends the password. I'm suspecting the CLI suffers from a [Mojibake](https://en.wikipedia.org/wiki/Mojibake#English) bug when posting passwords to login endpoint. \r\n\r\nFurther diagnostic follow. Hope this helps.\r\n\r\n----\r\n\r\nThe CLI offers no way to this display the sent password even with CF_TRACE we get ``grant_type=password&password=[PRIVATE DATA HIDDEN]&scope=&username=...``\r\n\r\nHowever here is a fiddler intercepted trace of the posted json when authenticating:\r\n\r\n```\r\n$ http_proxy=http://localhost:8888 cf auth userid 'é'\r\nAPI endpoint: https://api.[...]\r\nAuthenticating...\r\nFAILED\r\nCredentials were rejected, please try again.\r\n```\r\n\r\n```\r\nPOST https://login.[...]/oauth/token HTTP/1.1\r\nHost: login.[...]\r\nUser-Agent: go-cli 6.12.2-24abed3 / windows\r\nContent-Length: 58\r\nAccept: application/json\r\nAuthorization: Basic [...]\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip\r\n\r\ngrant_type=password&password=%C3%A9&scope=&username=userid\r\n```\r\n\r\nWe see that the password is encoded as %C3%A9 which in decimal correspond to two bytes with ascii values 195 169\r\n\r\nAs a comparison, the browsers when submitting the login form from webui such as run.pivotal.io URL encode the `é` character properly as ```password=%E9``` is single byte with 233 decimal value, as expected:\r\n\r\nUnicode number: U+00E9 dec 233 see http://unicode-table.com/en/#00E9\r\n\r\n%A9 is the value of é in the iso latin-1 cf http://www.ic.unicamp.br/~stolfi/EXPORT/www/ISO-8859-1-Encoding.html\r\n\r\nThis matches the symptoms of [Mojibake bug in english texts](https://en.wikipedia.org/wiki/Mojibake#English)\r\n"},"comment":{"url":"https://api.github.com/repos/cloudfoundry/cli/issues/comments/157875170","html_url":"https://github.com/cloudfoundry/cli/issues/560#issuecomment-157875170","issue_url":"https://api.github.com/repos/cloudfoundry/cli/issues/560","id":157875170,"user":{"login":"gberche-orange","id":4748380,"avatar_url":"https://avatars.githubusercontent.com/u/4748380?v=3","gravatar_id":"","url":"https://api.github.com/users/gberche-orange","html_url":"https://github.com/gberche-orange","followers_url":"https://api.github.com/users/gberche-orange/followers","following_url":"https://api.github.com/users/gberche-orange/following{/other_user}","gists_url":"https://api.github.com/users/gberche-orange/gists{/gist_id}","starred_url":"https://api.github.com/users/gberche-orange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberche-orange/subscriptions","organizations_url":"https://api.github.com/users/gberche-orange/orgs","repos_url":"https://api.github.com/users/gberche-orange/repos","events_url":"https://api.github.com/users/gberche-orange/events{/privacy}","received_events_url":"https://api.github.com/users/gberche-orange/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T21:46:37Z","updated_at":"2015-11-18T21:46:37Z","body":"Thanks Dies"}}