Sha256: 4795dccb18a577a79a87834d8524bf6623870edd5d7ace7a45bc0c0e6e897e89

Contents?: true

Size: 835 Bytes

Versions: 131

Compression:

Stored size: 835 Bytes

Contents

# Require this file if you need Unicode support.
require 'cucumber/platform'
require 'cucumber/formatter/ansicolor'

$KCODE='u' unless Cucumber::RUBY_1_9

if Cucumber::WINDOWS_MRI && `chcp` =~ /(\d+)/
  codepage = $1.to_i
  codepages = (1251..1252)

  if codepages.include?(codepage)
    Cucumber::CODEPAGE = "cp#{codepage}"
  
    require 'iconv'
    module Kernel
      alias cucumber_print print
      def print(*a)
        begin
          cucumber_print(*Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a))
        rescue Iconv::IllegalSequence
          cucumber_print(*a)
        end
      end

      alias cucumber_puts puts
      def puts(*a)
        begin
          cucumber_puts(*Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a))
        rescue Iconv::IllegalSequence
          cucumber_puts(*a)
        end
      end
    end
  end
end

Version data entries

131 entries across 131 versions & 10 rubygems

Version Path
aslakhellesoy-cucumber-0.1.100.1 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.100.2 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.100.3 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.100.4 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.100.5 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.10 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.11 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.12 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.13 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.14 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.15 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.17 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.18 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.19 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.20 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.21 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.22 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.23 lib/cucumber/formatter/unicode.rb
aslakhellesoy-cucumber-0.1.99.3 lib/cucumber/formatters/unicode.rb
aslakhellesoy-cucumber-0.1.99.6 lib/cucumber/formatter/unicode.rb