0

I am building a Rails application which needs the list of countries,cities.City should at least contain 100,000 peoples. I have found the data from Wikipedia.But I need a clarification city names contains some special letters.

Durrës - ë
Vicente López - ó
São Paulo - ã

I have googled and found these are accented syllable.

My question is

Can I directly insert these values into the database?
Can I search the database without any problem?

Thank you.

Soundar Rathinasamy
  • 6,658
  • 6
  • 29
  • 47

1 Answers1

1

If you set your database to store values as utf-8 you should be able to store a wide range of such values without problem.

When it comes to sorting and comparing the important thing is which collation you ask the database to use. In a nutshell a collation is a set of rules saying how strings are compared, for example how is é sorted relative to e, is ß equal to ss and so on.

When using full text search (solr, sphinx etc) you should ensure that your stop words, choice of stemmer and so on are Unicode aware

Frederick Cheung
  • 83,189
  • 8
  • 152
  • 174