0

I need generate a report json file in jenkins, but cucumber shows this error: "\xC3" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)"

I'm using in cucumber.yml this profile: cucumber: --format json -o cucumber.json

  • We don't have enough information to help you. The error means that some code is trying to convert a string from ASCII-8BIT to UTF-8 but the string contains the byte `\xC3`, which is not a valid ASCII character, so Ruby has no idea how to do the conversion. But from the information you've given we have no idea where the offending character is coming from. One possible solution is to use e.g. grep to search for the character in your code. Here's a relevant SO answer: http://stackoverflow.com/questions/6319878/using-grep-to-search-for-hex-strings-in-a-file/17168847#17168847 – Jordan Running Dec 05 '16 at 18:33

1 Answers1

0

If you desire to convert code point C3 or 195 (Ã) to its UTF-8 equivalent I use:

[195].pack('U')

In my testing, this works for values from 0 through 1_114_111.

Peter Camilleri
  • 1,882
  • 15
  • 17