5 ms·
Are people seriously still deliberately using ASCII-reliant code?
by lambada 14y ago
Are people seriously still deliberately using ASCII-reliant code?
- manojlds 14y agoIt's interesting. Doesn't mean it's worthy of being put in production code.
- easytiger 14y agoit does if the text you are dealing with is specified as ascii only
- yxhuvud 14y agoYes, when dealing with RFC's that do.
- olalonde 14y agoFor file names, URLs, domain names, etc. it's usually the safe thing to do.
- recursive 14y agoNot as often as often as handling all characters.
- UnoriginalGuy 14y agoWho's filenames aren't unicode? Also domains and URLs can be unicode too.
- esrauch 14y agohttp://en.wikipedia.org/wiki/IDN_homograph_attack http://en.wikipedia.org/wiki/IDN_homograph_attack
- olalonde 14y ago> Who's filenames aren't unicode? Many filesystems don't support unicode or support only a subset of it: https://en.wikipedia.org/wiki/Filename#Comparison_of_filename_limitations https://en.wikipedia.org/wiki/Filename#Comparison_of_filenam... > Also domains and URLs can be unicode too. Domains: it depends at which level you are dealing with them. See https://en.wikipedia.org/wiki/Internationalized_domain_name https://en.wikipedia.org/wiki/Internationalized_domain_name Internationalized domain names are stored in the Domain Name System as ASCII strings using Punycode transcription. URLs: Unicode characters are not allowed in URLs. See http://www.faqs.org/rfcs/rfc1738.html http://www.faqs.org/rfcs/rfc1738.html and http://www.blooberry.com/indexdot/html/topics/urlencoding.htm http://www.blooberry.com/indexdot/html/topics/urlencoding.ht... only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.
- IheartApplesDix 14y agoDid ducttape stop being sticky?
- csense 14y agoEvery time I've had to deal with Unicode and internationalization, it's been a problem. For example, a few years ago I grabbed a source tarball from somewhere, I forget what or where. It had the author's name in a comment, which included an O with dots over it. That was the only non-ASCII character in the source code. No matter what I did, both Eclipse and command-line javac refused to compile the source. Finally I wrote a script to delete his name from every source file manually. It compiled flawlessly. Then there's the time I found some text files with two characters of binary junk at the beginning, followed by completely normal text. Again, I forget what I was doing, but some program was refusing to process them correctly. It was something internationalization-related called the BOM. Eventually I ended up writing a script to walk a directory and remove the first two bytes of every file. (This can probably be done with dd and xargs on UNIX, but I was using Windows at the time, which means that something like this will require spending an hour or so in your favorite programming language.) These experiences lead me to believe that, for bootstrapped USA startups at least, you shouldn't worry about a market outside the English-speaking world. If you need to worry about junk like accented characters or moon runes (Chinese/Japanese/Korean characters), it means you're big enough to afford to hire someone specifically to address the problem.
- andrewflnr 14y agoWhat? You suffered from other peoples' bad internationalization, which implies that people shouldn't care about internationalization?
- token_female 14y ago> moon runes (Chinese/Japanese/Korean characters) Really? You can make your economic point without making fun of several of the world's most commonly spoken languages and the people who speak them.
- e12e 14y agoI assume this is a not very subtle troll? Java source is unicode? (The offhand reference to dd and xargs is a bit too much). How do you define "English-speaking world", btw? Those too ignorant to have heard of non-ascii-characters (ie: excluding Canada, as anyone doing business there should at least have heard of French)? Anyway, for anyone actually burnt by something similar on a GNU system try looking up recode(1).
- kamaal 14y agoI think HN is written Arc, which is not very Unicode friendly.
- StavrosK 14y agoΔοκιμή. EDIT: It works fine for comments, at least.