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

Fix for donwcase issue on non-latin strings #1

Merged
merged 5 commits into from
Jun 27, 2012

Conversation

netoneko
Copy link
Contributor

@netoneko netoneko commented Jun 6, 2012

Got 2 problems with cyrillic text:

  1. :remove_accents just destoys all cyrillic letters.
  2. Downcase does not happen because of str.mb_chars.to_s.doncase instead of str.mb_chars.down_case.to_s.

I've fixed second problem and just avoid first with disabling remove_accents.

Probably first problem worth mentioning in Readme.md file.

@dblock
Copy link
Contributor

dblock commented Jun 26, 2012

This is great, but could you please add a test or two? Thanks.

@netoneko
Copy link
Contributor Author

Okay, why not.

@netoneko
Copy link
Contributor Author

By the way, I ran the tests and replaced

      if config[:remove_accents]
        str = UnicodeUtils.nfkd(str).gsub(/[^\x00-\x7F]/,'')
      end

with

      if config[:remove_accents]
        str = UnicodeUtils.nfkd(str)
      end

Got all greens. Shouldn't this gsub just be removed? In that case it won't mess with Cyrillic letters.

@dblock
Copy link
Contributor

dblock commented Jun 27, 2012

I think you're right. @aaw, want to pitch in here?

@dblock
Copy link
Contributor

dblock commented Jun 27, 2012

@netoneko Please merge from upstream, there were some changes ...

@netoneko
Copy link
Contributor Author

Completed the merge.

@dblock
Copy link
Contributor

dblock commented Jun 27, 2012

Talked to @aaw. Merging. I am happy you've used a Russian art reference in the spec to keep things consistent :)

dblock added a commit that referenced this pull request Jun 27, 2012
Fix for donwcase issue on non-latin strings
@dblock dblock merged commit 8d9e601 into mongoid:master Jun 27, 2012
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.

3 participants