Comment by phoe-krk
Comment by phoe-krk 6 days ago
When I type in "Kraków, Poland", I get meet.hn/city/pl-undefined. Does your code handle diacritics correctly?
Comment by phoe-krk 6 days ago
When I type in "Kraków, Poland", I get meet.hn/city/pl-undefined. Does your code handle diacritics correctly?
Looks like even 80 years after the war, Germans haven't relinquished the city.¹
¹Stettin is an old German name for the city of Szczecin, which was taken from Germany and given to Poland to punish Germany and Poland² after the WW2.
²Poland lost 180k km² in the east, compared to 100k km² gained in the west.
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.
> 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.)
"Go make self more yellow, using gusle"[0]
[0] https://commons.wikimedia.org/wiki/File:Za%C5%BC%C3%B3%C5%82...
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?)
https://www.openstreetmap.org/relation/1973756 has `name=Thành phố Hồ Chí Minh` and `name:en= Ho Chi Minh City`
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.
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!
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
The code doesn't handle places that don't have a province, or similar concept on OpenStreetMap. See debugger: https://i.imgur.com/X379swH.png
It's not diacritics, it's something more broken with geo coding.
Szczecin, Poland is found but handle is pl-undefined as for you...
But what is more interesting, Stettin, Poland works ok... and link is surprisingly meet.hn/city/pl-Szczecin
Geocoding needs some love.