4 ms·
Fun fact: If you have the exclamation mark (!) in your Windows username, Java will think it's the jar separator and `getResourceAsStream` will refuse to work. T
by tyteen4a03 5y ago
Fun fact: If you have the exclamation mark (!) in your Windows username, Java will think it's the jar separator and `getResourceAsStream` will refuse to work. This broke many people's Minecraft installation over the years.
The bug in question [0] was reported in 2001 and remains unsolved 20 years later.
[0] https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4523159 https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4523159
- alisonkisk 5y agoThe only practical fix would be to ban ! in usernames.
- yooogle 5y agoClassic java
- kspacewalk2 5y agoI find the very idea of putting an exclamation mark on one's username and not expecting eventual problems to be quite curious.
- retrac 5y ago! is actually used as a regular letter with a phonetic value to write quite a few languages in Africa, usually representing a click sound. It's even in the name of some of them: https://en.m.wikipedia.org/wiki/%C7%83Kung_languages https://en.m.wikipedia.org/wiki/%C7%83Kung_languages
- edaemon 5y agoIt can be used to indicate a click sound in some languages and the IPA. Probably not the most common reason to come across this bug but it's a case worth considering. https://en.wikipedia.org/wiki/Exclamation_mark#Phonetics https://en.wikipedia.org/wiki/Exclamation_mark#Phonetics
- jmopp 5y agoThe Nama language has a letter that is often replaced with an exclamation mark in common typography. The lead actor in the film The God's Must be Crazy was named N!xau ǂToma
- nextaccountic 5y agoI find the idea of expecting names from other cultures to follow the customs of one's culture to be quite curious. https://shinesolutions.com/2018/01/08/falsehoods-programmers-believe-about-names-with-examples/ https://shinesolutions.com/2018/01/08/falsehoods-programmers... (but, in any case, this discussion here on HN https://news.ycombinator.com/item?id=18567548 https://news.ycombinator.com/item?id=18567548 provides some nuance)
- kspacewalk2 5y agoIt should not cause issues. For regular users, it should be an expectation that, in well-written software, it won't cause issues. But in our world of power+ users... It will cause issues. It just will. Maybe in some number of decades that won't be the case, but it's irrelevant right now.
- fencepost 5y agoWhether this seems like an issue may depend on whether it's a significant character on OSes you've used.
- yjftsjthsd-h 5y agoWith your programmer hat on, sure. But as a user and annoyed programmer, it's a disgrace that the contents of your username is treated as anything but a totally opaque string. It's like saying that of course putting semicolons into web forms will break them: not novel, still horrifying.
- vincnetas 5y agoi recommend reading this "Falsehoods Programmers Believe About Names". world is crazy place if you expect some system in how people name each other and are writing it down. https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
- skrebbel 5y agoWhen you start a Windows computer for the first time, Windows gives you a text box and asks you to choose a user name. It does not explain in detail what this means or what it is for. Does it really surprise you that people are going to type just about anything into that box that it will allow?
- selfhoster11 5y agoI just find it annoying, much like the fact that Unix shell still has trouble dealing with spaces in things.
- bluecatswim 5y agoReally? If someone asked you if exclamation marks in usernames would cause problems before you were aware of this, would you have said yes? It's a very common special character, it's not like it's a control character or some obscure unicode thing. Besides, it's a common thing to add to usernames outside of services where you use your real name.
- kspacewalk2 5y agoAbsolutely, I would have said yes to the question "do exclamation marks have the potential to cause problems in some piece of software or other, the likelihood going way up with the number and the obscurity of software you use on this machine".
- mkotowski 5y agoQuite a lot of languages use ! or ? as a letter. For example in Canada: https://en.wikipedia.org/wiki/Question_mark#Indigenous_languages_of_Canada https://en.wikipedia.org/wiki/Question_mark#Indigenous_langu...
- account42 5y agoThat looks like an example of languages using ? to represent a different but similar looking character.
- pvillano 5y agowell, a username can reasonably be limited to [a-zA-Z0-9_] but a name field should take Unicode
- GoblinSlayer 5y agoSimply install the game into %ProgramData%