pvande / differ

A simple gem for generating string diffs
347 stars 48 forks source link

Issue when outputting differences in ascii format with unicode chars #11

Open damian-m-g opened 8 years ago

damian-m-g commented 8 years ago

Hello sir. Please take a look at this:

image

The outputt:

image

How it looks when you write this content to a file:

image

The problem, found in ascii.rb:

image

The inspect is the problem. Is fine with none unicode strings, but when unicode appear it mess. The workaround we made:

image

How the file where string was written looks:

image

If this is okay for you, I can make a pull request, I'm not sure if fills expectations, probably it could be improved. Cheers.