okkez / coveralls-lcov

lcov support for coveralls.io
MIT License
26 stars 11 forks source link

Issue with "source sequence is illegal/malformed utf-8" #12

Closed oshadura closed 6 years ago

oshadura commented 6 years ago

Hi, I am using coveralls-lcov for a quite big project and I am getting next error:

...
Total:| 0.1% 583054| 0.1% 95045|    -      0
/home/travis/.rvm/gems/ruby-2.4.1/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/runner.rb:75:in `to_json': source sequence is illegal/malformed utf-8 (JSON::GeneratorError)
    from /home/travis/.rvm/gems/ruby-2.4.1/gems/coveralls-lcov-1.5.1/lib/coveralls/lcov/runner.rb:75:in `run'
    from /home/travis/.rvm/gems/ruby-2.4.1/gems/coveralls-lcov-1.5.1/bin/coveralls-lcov:5:in `<top (required)>'
    from /home/travis/.rvm/gems/ruby-2.4.1/bin/coveralls-lcov:19:in `load'
    from /home/travis/.rvm/gems/ruby-2.4.1/bin/coveralls-lcov:19:in `<main>'
    from /home/travis/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks1.9.1:15:in `eval'
    from /home/travis/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks1.9.1:15:in `<main>'

Is it possible to enforce encoding, for example with .force_encoding()?

okkez commented 6 years ago

Thank you for reporting issue.

Could you show me your source code? Or could you check your source code encoding? If you use non-UTF-8 encoding in your source code, you will see this error.

oshadura commented 6 years ago

Hi,
thank you so much for tip, I rechecked project sources and found one file with ISO-8859. Changing source code encoding to ASCII helps to solve my problem.

okkez commented 6 years ago

solved.

Thanks.