Skip to content

Commit

Permalink
remove superfluous encoding detection, which errors with ruby-1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Jul 6, 2012
1 parent d4f205f commit 47b7e9d
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions lib/vcard/vcard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -665,23 +665,6 @@ def Vcard.decode(card)
raise ArgumentError, "Vcard.decode cannot be called with a #{card.type}"
end

case string
when /^\xEF\xBB\xBF/
string = string.sub("\xEF\xBB\xBF", '')
when /^\xFE\xFF/
arr = string.unpack('n*')
arr.shift
string = arr.pack('U*')
when /^\xFF\xFE/
arr = string.unpack('v*')
arr.shift
string = arr.pack('U*')
when /^\x00B/i
string = string.unpack('n*').pack('U*')
when /^B\x00/i
string = string.unpack('v*').pack('U*')
end

string.force_encoding(Encoding::UTF_8)
entities = Vpim.expand(Vpim.decode(string))

Expand Down

0 comments on commit 47b7e9d

Please sign in to comment.