Skip to content

Commit

Permalink
add error tolerant values for Iconv when writing spreadsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghetticode committed Dec 2, 2012
1 parent 29228dc commit 9433614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/spreadsheet/encodings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def client string, internal='UTF-16LE'
def internal string, client=Spreadsheet.client_encoding
string = string.dup
key = ['UTF-16LE', client]
iconv = @@iconvs[key] ||= Iconv.new('UTF-16LE', client)
iconv = @@iconvs[key] ||= Iconv.new('UTF-16LE//TRANSLIT//IGNORE', client)
iconv.iconv string
end
def utf8 string, client=Spreadsheet.client_encoding
string = string.dup
key = ['UTF-8', client]
iconv = @@iconvs[key] ||= Iconv.new('UTF-8', client)
iconv = @@iconvs[key] ||= Iconv.new('UTF-8//TRANSLIT//IGNORE', client)
iconv.iconv string
end
end
Expand Down

0 comments on commit 9433614

Please sign in to comment.