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

Encoding issues with iso-8859 encoded files #117

Merged
merged 2 commits into from
May 10, 2012

Conversation

Deradon
Copy link
Contributor

@Deradon Deradon commented Mar 19, 2012

I had issues using simplecov with an file, that contained something like this:

# localized to Español thus:

Had no chance to edit this file, so I might provide a workaround here, so that simplecov can hande such files.

In one of my projects I use something like this for UTF-8 encoding:

def self.umlauts(text)
  # Read more: http://stackoverflow.com/questions/2982677/ruby-1-9-invalid-byte-sequence-in-utf-8
  # Switch to ruby 1.9 String#encode,  with backward 1.8 compatibility
  if text.respond_to?(:encode!)
    text.encode!('UTF-8', 'UTF-8', :invalid => :replace)
  else
    require 'iconv'
    text = Iconv.conv('ISO_8859-15//IGNORE//TRANSLIT', 'UTF-8', text)
  end
end

@ghost ghost assigned colszowka May 10, 2012
colszowka added a commit that referenced this pull request May 10, 2012
Encoding issues with iso-8859 encoded files
@colszowka colszowka merged commit 3d6554f into simplecov-ruby:master May 10, 2012
@colszowka
Copy link
Collaborator

Sorry I left this lying around for quite a while. Thanks for your effort, merged and will be released in the next version, hopefully today.

@Deradon
Copy link
Contributor Author

Deradon commented May 10, 2012

Thanks for your effort maintaining this repo.
I'm really glad to hava a code-coverage tool for ruby 1.9.2+ :)

jperkin pushed a commit to TritonDataCenter/pkgsrc-legacy that referenced this pull request Dec 9, 2013
v0.6.4, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.3...v0.6.4))
-------------------

  * [BUGFIX] Encoding issues with ISO-8859-encoded source files fixed.
    See simplecov-ruby/simplecov#117. (thanks to @Deradon)
  * [BUGFIX] Ensure ZeroDivisionErrors won't occur when calculating the coverage result, which previously
    could happen in certain cases. See simplecov-ruby/simplecov#128. (thanks to @japgolly)
  * [REFACTORING] Changed a couple instance variable lookups so SimpleCov does not cause a lot of warnings when
    running ruby at a higher warning level. See simplecov-ruby/simplecov#106 and
    simplecov-ruby/simplecov#119. (thanks to @mvz and @gioele)


v0.6.3, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.2...v0.6.3))
-------------------

  * [BUGFIX] Modified the API-changes for newer multi_json versions introduced with #122 and v0.6.2 so
    they are backwards-compatible with older multi_json gems in order to avoid simplecov polluting
    the multi_json minimum version requirement for entire applications.
    See simplecov-ruby/simplecov#132
  * Added appraisal gem to the test setup in order to run the test suite against both 1.0 and 1.3
    multi_json gems and ensure the above actually works :)
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Oct 11, 2014
v0.6.4, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.3...v0.6.4))
-------------------

  * [BUGFIX] Encoding issues with ISO-8859-encoded source files fixed.
    See simplecov-ruby/simplecov#117. (thanks to @Deradon)
  * [BUGFIX] Ensure ZeroDivisionErrors won't occur when calculating the coverage result, which previously
    could happen in certain cases. See simplecov-ruby/simplecov#128. (thanks to @japgolly)
  * [REFACTORING] Changed a couple instance variable lookups so SimpleCov does not cause a lot of warnings when
    running ruby at a higher warning level. See simplecov-ruby/simplecov#106 and
    simplecov-ruby/simplecov#119. (thanks to @mvz and @gioele)


v0.6.3, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.2...v0.6.3))
-------------------

  * [BUGFIX] Modified the API-changes for newer multi_json versions introduced with #122 and v0.6.2 so
    they are backwards-compatible with older multi_json gems in order to avoid simplecov polluting
    the multi_json minimum version requirement for entire applications.
    See simplecov-ruby/simplecov#132
  * Added appraisal gem to the test setup in order to run the test suite against both 1.0 and 1.3
    multi_json gems and ensure the above actually works :)
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

Successfully merging this pull request may close these issues.

2 participants