2
# Ideally we would use Norwegian keywords here, but that won't work unless this file is UTF-8 encoded.
3
# Alternatively it would be possible to use Norwegian keywords and encode the file as UTF-8.
5
# In both cases, stepdef arguments will be sent in as UTF-8, regardless of what encoding is used.
6
Given /^jeg drikker en "([^"]*)"$/ do |drink|
7
drink.should == utf8('�l', 'iso-8859-1')
10
When /^skal de andre si "([^"]*)"$/ do |greeting|
11
greeting.should == utf8('sk�l', 'iso-8859-1')
15
def utf8(string, encoding)
16
if string.respond_to?(:encode) # Ruby 1.9
17
string.encode('UTF-8')
20
Iconv.new('UTF-8', encoding).iconv(string)
b'\\ No newline at end of file'