I'm developing an application where people around the world enter an address, city or something else in a search box. Then they can select the results that match their target. The selected result contains text from the address.components long_name.
some examples returned by the geocoder API:
"long_name" : "King's Street",
"short_name" : "King's St",
"types" : [ "route" ]
"long_name" : "Newport",
"short_name" : "Newport",
"types" : [ "postal_town" ]
"long_name" : "Staffordshire",
"short_name" : "Staffordshire",
"types" : [ "administrative_area_level_2", "political" ]
In this case I would e.g. store:
"King's Street"
"Newport"
"Staffordshire"
into my database.
Then... this application can store from locations from all countries, and in potentially all official native languages used in those countries - by google in the "long_name" strings. Note that I set both the country and the language in the geocoder, in order to both show the map in the native language of the user, as well as getting back the result (address.components strings) in the correct language for the user.
Does anyone know if the address.components long_names can be stored precisely (character set wise) when using UTF-8 in MySql (that is a 3-byte UNICODE), or if I need to use the utf8mb4 charset (4-byte UNICODE)?
If I need to use the utf8mb4 charset, what is the reason for that? Which languages stored by Google Geocoder require utf8mb4 (4-byte) UNICODE, in order to not loose any character/language information when storing in the database?