title: heroku JSON::GeneratorError: source sequence is illegal/malformed utf-8 when trying to deploy rails app
body: <p>Since I have added external css and js files to my rails app, I am encountering problems deploying my app to Heroku. I get the following error when the assets are precompiled :</p>
  
  <pre><code>JSON::GeneratorError: source sequence is illegal/malformed utf-8
  </code></pre>
  
  <p>As suggested in <a href="https://stackoverflow.com/questions/31372478/rake-aborted-jsongeneratorerror-source-sequence-is-illegal-malformed-utf-8-a">rake aborted! JSON::GeneratorError: source sequence is illegal/malformed utf-8 after rake assets:precompile</a>, I installed isutf8 and ran the following command at my app folder level :</p>
  
  <pre><code>isutf8 *
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0GUWy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0GUWy.png" alt="enter image description here"></a></p>
  
  <p>It doesnt return any output which makes me think that the files in my app folder are valid utf8.
  Am I using the isutf8 tool correctly ? If yes, it should output invalid utf8 files as this is why heroku is crashing right ?</p>