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

Support unicode languages #234

Merged
merged 3 commits into from
Apr 8, 2015
Merged

Support unicode languages #234

merged 3 commits into from
Apr 8, 2015

Conversation

jondeandres
Copy link
Contributor

In order to support languages with "rare" unicode chars, we cannot force encoding always from binary.

Instead, we can try to detect if the string is an explicit ASCII encoding, so then we force from binary. And if not, we just encode the string with the same options: { :invalid => :replace, :undef => :replace, :replace => '' }.

Note: force_to_ascii helper in tests is just to enforce to ascii for rubies > 1.8.

jondeandres added a commit that referenced this pull request Apr 8, 2015
@jondeandres jondeandres merged commit 276d863 into master Apr 8, 2015
@jondeandres jondeandres deleted the support-unicode-languages branch April 8, 2015 16:56
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.

1 participant