Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow umlauts in passwords #4

Merged
merged 2 commits into from
Apr 2, 2013
Merged

Allow umlauts in passwords #4

merged 2 commits into from
Apr 2, 2013

Conversation

pencil
Copy link
Contributor

@pencil pencil commented Apr 2, 2013

Fixes the following error:

Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8

@pencil
Copy link
Contributor Author

pencil commented Apr 2, 2013

Added. And moved it to the valid? method to fix the error for SHA as well.

@mogest
Copy link
Owner

mogest commented Apr 2, 2013

Thanks. I'll merge this, but I'm going to make a change to how it's done:

if password.respond_to?(:encode)
  password = password.encode("UTF-8")
  password.force_encoding("ASCII-8BIT")
end

so that non-UTF8 strings get converted to UTF-8 first. force_encoding updates the string itself, too, so having that copy there means the caller doesn't get their string changed on them.

Thanks again!

@mogest mogest closed this Apr 2, 2013
@mogest mogest reopened this Apr 2, 2013
mogest added a commit that referenced this pull request Apr 2, 2013
@mogest mogest merged commit b00c4d7 into mogest:master Apr 2, 2013
@pencil pencil deleted the handle-umlauts branch April 3, 2013 06:26
@pencil
Copy link
Contributor Author

pencil commented Apr 3, 2013

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants