Sha256: 329b1a942aafba6f08b1f03f71f32265fb93b69b7e5edde96745c91963b4f4a1

Contents?: true

Size: 637 Bytes

Versions: 3

Compression:

Stored size: 637 Bytes

Contents

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

$KCODE='u'

if $CUCUMBER_WINDOWS_MRI && `chcp` =~ /Active code page: (\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)
        cucumber_print *Iconv.iconv($CUCUMBER_CODEPAGE, "UTF-8", *a)
      end

      alias cucumber_puts puts
      def puts(*a)
        cucumber_puts *Iconv.iconv($CUCUMBER_CODEPAGE, "UTF-8", *a)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
aslakhellesoy-cucumber-0.1.13.2 lib/cucumber/formatters/unicode.rb
aslakhellesoy-cucumber-0.1.13 lib/cucumber/formatters/unicode.rb
cucumber-0.1.13 lib/cucumber/formatters/unicode.rb