Remix.run Logo
ajsnigrutin 18 hours ago

Yeah, that'll work great..

https://en.wikipedia.org/wiki/%C4%8Celje

echo "Čelje" | uconv -f "UTF-8" -t "UTF-8" -x "Latin-ASCII"

> "Celje"

https://en.wikipedia.org/wiki/Celje

(i mean... we do have postal numbers just for problems like this, but both Štefan and Stefan are not-so-uncommon male names over here, so are Jozef and Jožef, etc.)

jeroenhd 17 hours ago | parent | next [-]

If you're dealing with a bad API that only takes ASCII, "Celje" is usually better than "ÄŒelje" or "蒌elje".

If you have control over the encoding on the input side and on the output side, you should just use UTF-8 or something comparable. If you don't, you have to try to get something useful on the output side.

Muromec 18 hours ago | parent | prev [-]

Most places where telling Štefan from Stefan is a problem use postal numbers for people too, or/and ask for your DOB.

ajsnigrutin 17 hours ago | parent [-]

I don't have a problem from differentiatin Štefan from Stefan, 's' and 'š' sound pretty different to everyone around here. But if someone runs that script above and transliterates "š" to "s" it can cause confusion.

And no, we don't use "postal numbers for humans".

Muromec 16 hours ago | parent [-]

>And no, we don't use "postal numbers for humans".

An email, a phone number, a tax or social security number, demographic identifier, billing/contract number or combination of them.

All of those will help you tell Stefan from Štefan in the most practical situations.

>But if someone runs that script above and transliterates "š" to "s" it can cause confusion.

It's not nice, it will certainly make Štefan unhappy, but it's not like you will debit the money from the wrong account or deliver to a different address or contact the wrong customer because of that.