From the course: Developing Unicode-Aware Applications in Go

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Normalization

Normalization

- [Instructor] Say you're a company running tours in cities. So you have a database with tours which has a city which is string and the date when the tour is happening. And for our purpose, our database is just going to be an in-memory slice. When I'm inserting a tour, I'm inserting the city, the year, month, and the date. I'm creating a tour with city and then time.Date of this time in UTC and appending to the database, basically an insert. And now I can search by city. I have matches, I'm going over the tour for two city equal to the city that we're looking for. I'm appending it and then returning the matches. And now for a little test. So city1 is Krakow and city2 is Krakow as well. Having a tour at 17th of May in 2025 in Krakow. So I'm inserting with city1 and searching with city2. And let's run the code And let's view the debug console. And as you guess, because I'm showing you that, there's no match. But if you look at the cities, they look exactly the same, same characters…

Contents