File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -366,20 +366,11 @@ def self.to_raw(str)
366
366
end
367
367
368
368
#
369
- # Converts ISO-8859-1 to UTF-8
369
+ # Converts US-ASCII and ISO-8859-1 to UTF-8, skipping over
370
+ # any characters which don't convert cleanly.
370
371
#
371
372
def self . to_utf8 ( str )
372
-
373
- if str . respond_to? ( :encode )
374
- # Skip over any bytes that fail to convert to UTF-8
375
- return str . encode ( 'utf-8' , { :invalid => :replace , :undef => :replace , :replace => '' } )
376
- end
377
-
378
- begin
379
- Iconv . iconv ( "utf-8" , "iso-8859-1" , str ) . join ( " " )
380
- rescue
381
- raise ::RuntimeError , "Your installation does not support iconv (needed for utf8 conversion)"
382
- end
373
+ str . encode ( 'utf-8' , { :invalid => :replace , :undef => :replace , :replace => '' } )
383
374
end
384
375
385
376
#
You can’t perform that action at this time.
0 commit comments