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

Diff does't work with unicode #7

Closed
valodzka opened this issue Jun 14, 2010 · 3 comments
Closed

Diff does't work with unicode #7

valodzka opened this issue Jun 14, 2010 · 3 comments

Comments

@valodzka
Copy link

In some cases diff сuts unicode charachres (cyrilic for example). Adding mb_chars to diff_lcs solves problem:

diffs = Diff::LCS.sdiff( (old_text || '').mb_chars, (new_text || '').mb_chars ) # Building symmetric diff sequence    
@alno
Copy link
Owner

alno commented Jun 14, 2010

Thanks, fixed.

@valodzka
Copy link
Author

I don't understand definitely why, but this fix require change in Irwi::Comparators::Spans::NotChangedSpan (.to_s instead of simple @value)

def to_s
  @value.to_s
end

It uses some kind inspect instead of to_s otherwise

@alno
Copy link
Owner

alno commented Jun 14, 2010

Ok, released, i think this is because result of mb_chars in fact not a string

This issue was closed.
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

No branches or pull requests

2 participants