Sha256: 8a4837d7d1e20c6cec91db6d4137acfe12c6ce217c650079fbf78f6044ab0195

Contents?: true

Size: 844 Bytes

Versions: 41

Compression:

Stored size: 844 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 #:nodoc:
      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

41 entries across 41 versions & 8 rubygems

Version Path
kbaum-cucumber-0.4.5.pre lib/cucumber/formatter/unicode.rb
cucumber-0.4.5.rc1 lib/cucumber/formatter/unicode.rb
middleman-0.10.17 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/formatter/unicode.rb
middleman-0.10.16 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/formatter/unicode.rb
middleman-0.10.15 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/formatter/unicode.rb
rackjour-0.1.8 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/formatter/unicode.rb
middleman-0.10.14 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/formatter/unicode.rb
cucumber-0.4.4 lib/cucumber/formatter/unicode.rb
cucumber-0.4.3 lib/cucumber/formatter/unicode.rb
cucumber-0.4.2 lib/cucumber/formatter/unicode.rb
cucumber-0.4.1 lib/cucumber/formatter/unicode.rb
cucumber-0.4.0 lib/cucumber/formatter/unicode.rb
cucumber-0.4.0.rc1 lib/cucumber/formatter/unicode.rb
cucumber-0.3.104 lib/cucumber/formatter/unicode.rb
cucumber-0.3.103 lib/cucumber/formatter/unicode.rb
cucumber-0.3.102 lib/cucumber/formatter/unicode.rb
cucumber-0.3.101 lib/cucumber/formatter/unicode.rb
cucumber-0.3.100 lib/cucumber/formatter/unicode.rb
cucumber-0.3.99 lib/cucumber/formatter/unicode.rb
cucumber-0.3.98 lib/cucumber/formatter/unicode.rb