Skip to content

Encoding issues with iso-8859 encoded files #117

Merged
merged 2 commits into from May 10, 2012

2 participants

@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
@colszowka colszowka was assigned May 10, 2012
@colszowka colszowka merged commit 3d6554f into colszowka:master May 10, 2012
@colszowka
Owner

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
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 jperkin pushed a commit to joyent/pkgsrc that referenced this pull request Dec 9, 2013
taca Update ruby-simplecov to 0.6.4.
v0.6.4, 2012-05-10 ([changes](colszowka/simplecov@v0.6.3...v0.6.4))
-------------------

  * [BUGFIX] Encoding issues with ISO-8859-encoded source files fixed.
    See colszowka/simplecov#117. (thanks to @Deradon)
  * [BUGFIX] Ensure ZeroDivisionErrors won't occur when calculating the coverage result, which previously
    could happen in certain cases. See colszowka/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 colszowka/simplecov#106 and
    colszowka/simplecov#119. (thanks to @mvz and @gioele)


v0.6.3, 2012-05-10 ([changes](colszowka/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 colszowka/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 :)
0410186
@jsonn jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Oct 11, 2014
taca Update ruby-simplecov to 0.6.4.
v0.6.4, 2012-05-10 ([changes](colszowka/simplecov@v0.6.3...v0.6.4))
-------------------

  * [BUGFIX] Encoding issues with ISO-8859-encoded source files fixed.
    See colszowka/simplecov#117. (thanks to @Deradon)
  * [BUGFIX] Ensure ZeroDivisionErrors won't occur when calculating the coverage result, which previously
    could happen in certain cases. See colszowka/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 colszowka/simplecov#106 and
    colszowka/simplecov#119. (thanks to @mvz and @gioele)


v0.6.3, 2012-05-10 ([changes](colszowka/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 colszowka/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 :)
93cae9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.