7 ms·
I'm not a web developer but whenever this kind of thing happens I just wonder why there isn't a single standard library in every common web language to deal wit
by fantod 6y ago
I'm not a web developer but whenever this kind of thing happens I just wonder why there isn't a single standard library in every common web language to deal with this and if there is, why it's not being used more often.
- rusticpenn 6y agoWhy do you need a library. Name is an open input field. As long as the inputs are sanitized, you should just accept whatever is typed there.
- kace91 6y agoDepends on the language and what you'll use the name for. Some names change capitalisation when the last name is used by itself vs full name for example. In some languages a name affect the words around it in a sentence (for a random example, an "o" in Spanish (or) becomes "u" when the next word starts by the "o" sound -> "Carlos o Maria", but "Carlos u Oscar". In general, for a sufficiently large and well-localised application you will need to modify or parse the name at some point. Not sure that a library can do that properly though.
- rusticpenn 6y agoI agree with you, however these are small issues compared to having arbitrary requirements for names which create real life problems.
- enriquto 6y agoDo you really need a library for that? Why can't you leave the name as it was entered by the user, without making further assumptions?
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- thelean12 6y agoBecause people will abuse everything. Whether it's curse words or porn websites or whatever.
- minitech 6y agoMaking assumptions about name formatting doesn't stop name fields from being abused in those ways.
- enriquto 6y ago> Whether it's curse words I guess most plain english words would be curse words in other languages. Conversely, many plain words and names in other languages will be incorrectly interpreted as english curse words. There's no way to avoid this. Forbidding english curse words would be extremely offensive to people whose name coincides with those words.
- thelean12 6y agoAnd these are discussions to be had when developing, including what to do when someone does abuse the lack of curse word filters. Because people WILL abuse it. The same discussion will also have to talk about whether Mr. SomepornwebsiteDOTcom or Mrs. Hitlerdidnothingwrong are real people and what to do about it.
- hutzlibu 6y agoThere is no need for a libaray, there is just need for a consistent standard. Meaning, if all programms would use UTF-8, fine. But they don't. But character -encoding is somewhat complicated, because there are a lot of languages out there. Some who even need more than 2 bytes per character, so you get special cases, which break on another system etc.
- z3t4 6y agoMost programs use something that is compatible with UTF-8. And UTF-8 is also backwards compatible with ASCII which is why A-z usually works. I actually think UTF-16 is the most common. The issues start to arise when three or more code points/bytes are combined into one character/glyph.
- moksly 6y agoBeing in the public sector, doing our 3rd party integration and being from Denmark gets me the joy of having to deal with a lot of relatively different APIs of very varied quality and æøå in names. Sometimes when people think they are using UTF-8, they aren’t. I’m not sure if that’s because they are incompetent or if their tooling lies to them, but I’ve gone through soooooo many weird encodings over the years trying to match what was specified as standard UTF-8.
- mytailorisrich 6y agoNames are too complicated and too personal. The issue is that many developers have an urge to do some 'clever' processing on them when, really, my conclusion is that they should be left alone. Just sanitise them for security purpose and that's it. This is a typical 'less is more' scenario. The best person to write a specific name as it should be is the person the name belongs to, so just let them do it.
- dmurray 6y ago> The best person to write a specific name as it should be is the person the name belongs to, so just let them do it. It's inconvenient to have the person you are writing about copyedit all of your writing. How would that even work? And if you don't allow them to do that, how do you account for the situation here where Mr de Zwart's name is capitalized differently depending on context? I'm not even sure if I have it right here.
- cryvate1284 6y agoIn this case, the problem arises, because they are using Mr de Zwart [sic], but can this not by avoided by simply using the full name? Mr Thomas de Zwart? Previously I wasn't a big fan of this style, but it has grown on me, and I see it now as similar using "they" instead of he/she for an unspecified person. Why assume anything about the name, when you can reuse it verbatim when needed?
- dmurray 6y agoThis seems like a reasonable try but there are some problems here too. What if you're quoting someone else who called him (in speech) Mr de Zwart? Or when you find out that it's correct to use the Emperor of Japan's full name in some circumstances, but extremely insulting in another? I think at some point you abandon looking for a general solution, and employ an expert editor who can advise you on the right style. If you're writing for a small town newspaper far away from the Netherlands and get this wrong because you don't have that expert editor, that's OK, you tried. But if you're Facebook and you have 10 million Dutch customers and you get this wrong setting the policy for the most prominent few words on the whole site, you can afford to have better standards than that.
- numpad0 6y agoUTF-8 exists, just not recognized its necessity where it’s needed ʕ´•ᴥ•`ʔ