Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/place.rb

Instance Method Summary collapse

Instance Method Details

#to_sym_cityObject



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/place.rb', line 76

def to_sym_city
  I18n.config.available_locales = :en
  begin
    return_string =  I18n.transliterate( self ).tr( " ", "" ).downcase.to_sym
    return return_string
  rescue Encoding::CompatibilityError => e
    raise unless return_string =  I18n.transliterate( self.encode( "UTF-8", "IBM437", invalid: :replace, undef: :replace ) ).tr( " ", "" ).downcase.to_sym
    puts e
    puts e.backtrace.inspect
  end
end