packsaddle / ruby-git_diff_parser

Parse `git diff` into patches and lines.
http://packsaddle.org
MIT License
33 stars 14 forks source link

GitDiffParser::Patches.parse(cp932 text) raises `ArgumentError: invalid byte sequence in UTF-8` #91

Closed sanemat closed 7 years ago

sanemat commented 8 years ago

GitDiffParser::Patches.parse(cp932 text) raises ArgumentError: invalid byte sequence in UTF-8

here: https://github.com/packsaddle/ruby-git_diff_parser/blob/8dd67cfa619ab276635d83648480e1645ccf748a/lib/git_diff_parser/patches.rb#L22

bootstraponline commented 8 years ago

https://robots.thoughtbot.com/fight-back-utf-8-invalid-byte-sequences

sanemat commented 8 years ago

You should set LANG=en_US.UTF-8. It works fine :)

bootstraponline commented 8 years ago

You should set LANG=en_US.UTF-8. It works fine :)

It doesn't. Comment out the fix and run the spec to see.

daniel-beard commented 7 years ago

Also running into this issue. Can confirm that the fix listed above by @sanemat does not work.

masa-iwasaki commented 7 years ago

@sanemat I crated a PR for this issue. Can you take a look ?

sanemat commented 7 years ago

I added #147 workaround, and shipped v3.0.0 :tada: