Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError) #151

Closed
nilcolor opened this issue Aug 13, 2014 · 1 comment

Comments

@nilcolor
Copy link

I have this spec:

  post 'parts/certificates' do
    let(:new_attributes) do
      {
        number: '000100300ASD',
        mask: 'РОСС @@.@@@@.@@@@@@', # РОСС is russian chars btw
      }
    end

    example 'Create certificate' do
      do_request new_attributes

      expect(response_status).to eq 201
      expect(response_headers['Location']).to match %r{/parts/certificates/\d}
    end
  end

Now, tests are passes OK and this is fine. But documentation generation fails. I'm not sure URI.encode/etc should be used here.
Error stack:

~/code/project/vendor/bundle/ruby/2.1.0/gems/mustache-0.99.5/lib/mustache/template.rb:906:in `block in render': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/mustache-0.99.5/lib/mustache/template.rb:906:in `map'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/mustache-0.99.5/lib/mustache/template.rb:906:in `render'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/mustache-0.99.5/lib/mustache/template.rb:43:in `render'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/mustache-0.99.5/lib/mustache.rb:119:in `render'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/writers/general_markup_writer.rb:18:in `block (2 levels) in write'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/writers/general_markup_writer.rb:17:in `open'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/writers/general_markup_writer.rb:17:in `block in write'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/writers/general_markup_writer.rb:13:in `each'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/writers/general_markup_writer.rb:13:in `write'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/writers/writer.rb:13:in `write'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/api_documentation.rb:27:in `block in write'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/api_documentation.rb:26:in `each'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/api_documentation.rb:26:in `write'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/api_formatter.rb:38:in `each'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bundler/gems/rspec_api_documentation-b8600c84c727/lib/rspec_api_documentation/api_formatter.rb:38:in `stop'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/reporter.rb:137:in `block in notify'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/reporter.rb:136:in `each'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/reporter.rb:136:in `notify'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/reporter.rb:131:in `stop'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/reporter.rb:113:in `finish'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/reporter.rb:56:in `report'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:108:in `run_specs'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:86:in `run'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:70:in `run'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:38:in `invoke'
  from ~/code/project/vendor/bundle/ruby/2.1.0/gems/rspec-core-3.0.3/exe/rspec:4:in `<top (required)>'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bin/rspec:23:in `load'
  from ~/code/project/vendor/bundle/ruby/2.1.0/bin/rspec:23:in `<main>'
@oestrich
Copy link
Contributor

oestrich commented Oct 8, 2014

Going to close this unless it's still happening after merging #164

@oestrich oestrich closed this as completed Oct 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants