Comment by sirobg

Comment by sirobg 10 months ago

12 replies

Well, congrats on finding the second bug! Thanks!

This one is pretty big, even as big as it's funny.

> Does your code handle diacritics correctly?

It seems it doesn't, no. Sorry for this. It's my first attempt at an international product.

To give you more details, I'm using this query to fetch cities data: https://nominatim.openstreetmap.org/search?city=${rawCity}&c...

I probably shouldn't have restricted accept-language to en-US. I'll investigate and make this work.

dualogy 10 months ago

> I'm using this query to fetch cities data

There's also downloadable CSV lists of the world's place names at https://geonames.org (and stably have been kept available and updated for many years by now) — if you already have a DB (likely in your case), script up some csv-to-dbtable dumping and thus you save on networked API call overheads just for querying the world's existing place names.

(It's regularly updated so best to keep the convert-and-dump script or logic around if you go that route.)

phoe-krk 10 months ago

No problem. As a Polish person, it is my duty to find zażółć-gęślą-jaźń-related bugs in other people's code.

CapsAdmin 10 months ago

I live in Vietnam and have the same problem I think. My city has diacritics in its name, but the query

https://nominatim.openstreetmap.org/search?city=B%E1%BA%AFc-...

works fine.

Unlike the parent post, it does not go to undefined, it just returns 404 when clicking on the map.

Some 404 examples:

https://meet.hn/city/vn-B%E1%BA%AFc-Ninh https://meet.hn/city/vn-H%C3%A0-N%E1%BB%99i

Working examples in Vietnam

https://meet.hn/city/vn-Da-Nang https://meet.hn/city/vn-Ho-Chi-Minh-City

(technically the last examples should be Đà Nẵng and Thành phố Hồ Chí Minh, but I guess because they are internationally known cities, they use the English names?)

  • habi 10 months ago

    https://www.openstreetmap.org/relation/1973756 has `name=Thành phố Hồ Chí Minh` and `name:en= Ho Chi Minh City`

    • CapsAdmin 10 months ago

      Aha, so in the case of Bắc Ninh, its English name is the same as it is in Vietnamese; with diacritics.

      I was going to say Da Nang and Ho Chi Minh City have gotten english names indirectly due to their popularity or relevance in Vietnam, but the main capital of Vietnam, Hà Nội, has the same problem as Bắc Ninh where its English name is the same as the Vietnamese name.

      I guess there's no logical reason behind this, as this sort of data is likely crowd sourced.

Cosi1125 10 months ago

Even worse than that, it's not possible to view cities with non-English characters in their names – like Łódź, but also Jyväskylä or İzmir.

sebastiennight 10 months ago

This is probably the first time I've seen a diacritics/text-encoding problem created by a French developer, rather than us French folks complaining about US-centric language decisions!

If you want anybody on HN to access, you might want accept-language to be set to an asterisk `*`.

Good luck and I hope we can someday meet up if I'm in Toulouse!

Nemo42 10 months ago

Hey, this is awesome - your doing a great job. Anything that exists will not exist perfectly - you had to make this real to have that bug found by that random person - well done!

Also I wouldn't lose much sleep over the English reqs. I've had many people tell me that English is the global language that weren't born in native English speaking countries.

Most recent example, a Mod was going off about how a certain help page was setup for English questions only and she did this whole explanation about it, apologized for the system.

The majority of replies was some variant of just say "International Chat" next time - people from everywhere all in agreement.

If you made this in German, French or Japanese - I'd agree with you. I think English is the expectation these days tho