Live data from Hacker News

I couldn't debug the code because of my name

mikolaj-kaminski.com

51–60 of 300 posts

Re: I couldn't debug the code because of my name

#52
post #19

And yet it's one of the simplest things to add non-ASCII chars to your tests to validate their handling. It's like not testing if your calculate application can handle negative numbers or decimals.

In fact it's trivial to generate a text file of all valid Unicode code points and use that as input to unit tests.

It may be faster to generate them on the fly. Iterating over ranges of integers is a lot faster than reading files from disk.

Re: I couldn't debug the code because of my name

#53
post #2

It's somewhat common to see videogames issue a patch shortly after release where they fix crashes due to non-ASCII Windows usernames or non-English locales. I'm not sure what the root cause of the confusion is, other than text strings being hard in general.

Part of the problem is legacy Windows cruft. For long time to properly handle Unicode characers you needed to explictly use widechar UTF-16 functions. Legacy narrow encoding is systemwide setting, couldn't be set to UTF8, thus only subset of characters would be represented correctly. Only recently they introduced ability to set narrow encoding for application to UTF-8 with setlocale, which is a lot saner.

Re: I couldn't debug the code because of my name

#54
post #27
post #6

What’s wrong with just writing it as Mikolaj? It’s not like it’s a kanji or something.

Because it's not his name. Imagine you are John but you had to make do with Yohn because the people designing you software didn't need the letter J...

It's not strange to localize your name. In ASL for example, you could sign your English name letter-by-letter, but it's much more common to have a totally new sign for your name - usually a word combined with the first letter of your name. Taking part in a different system often means taking on another name.

Re: I couldn't debug the code because of my name

#55
post #27

Earlier quoted context omitted.

Because it's not his name. Imagine you are John but you had to make do with Yohn because the people designing you software didn't need the letter J...

It's not strange to localize your name. In ASL for example, you could sign your English name letter-by-letter, but it's much more common to have a totally new sign for your name - usually a word combined with the first letter of your name. Taking part in a different system often means taking on another name.

It seems that you're implying computers are universally american and therefore people are expected to speak/use/adapt to american.

Re: I couldn't debug the code because of my name

#56
post #51

The domain name to the website is all ascii..

If you use a Microsoft account to set up windows then you have no control over the local username.

That sucks.. always hated the idea of an online account to access your local system..

Re: I couldn't debug the code because of my name

#57
The amount of random encoding problems that still exist are so bizarre. I recently left a UK job after already leaving the country more than a year ago, and in their attempt to mail P45 form to my new address (in Moscow) the only bits that survived are the string "c/o" and the postal code.

Re: I couldn't debug the code because of my name

#58
post #19

And yet it's one of the simplest things to add non-ASCII chars to your tests to validate their handling. It's like not testing if your calculate application can handle negative numbers or decimals.

In fact it's trivial to generate a text file of all valid Unicode code points and use that as input to unit tests.

I would have to do research on whether the list of valid code points depends on the Unicode version. For example, can regional indicator code points (https://en.wikipedia.org/wiki/Regional_indicator_symbol) appear in isolation? If not, is that different in Unicode Similarly, what about tags (https://en.wikipedia.org/wiki/Tags_(Unicode_block) )? Do these require an U+E007F CANCEL TAG?

The 66 noncharacters certainly need consideration. http://www.unicode.org/faq/private_use.html says:

“Because of this complicated history and confusing changes of wording in the standard over the years regarding what are now known as noncharacters, there is still considerable disagreement about their use and whether they should be considered "illegal" or "invalid" in various contexts”

Edit: also, testing all code points likely is overkill and using code points in isolation likely isn’t enough. Most tests are better of with something like the big list of naughty strings (https://github.com/minimaxir/big-list-of-naughty-strings)

Re: I couldn't debug the code because of my name

#59
post #46
post #29

Earlier quoted context omitted.

When you have non-standard characters in your name you quickly learn to never use them in computers since even though most systems works fine, some don't. And you can't fix all the thousands of systems your name has to interact with. I even had trouble booking flight tickets since their security system couldn't parse my name, and then had to go through some special security check due to it returning errors. After tha…

> When you have non-standard characters in your name 'standard' by what measure? Ł is more standard than X or Q in the polish alphabet. ~ Sincerely, a person whose name contains „ń” and therefore had to deal with this bullshit his entire life.

From a programmers perspective. The characters in my name are standard where I come from, but they are not standard to the international air travel security systems likely developed by Americans.

Edit: You know how aircraft travel security always transforms your name into letters from the English alphabet to parse? Yeah, it transformed my name and then the resulting string looked so bad that the system rejected that. The original name doesn't look bad, but after transformations it did...

Re: I couldn't debug the code because of my name

#60
post #45
post #29

Earlier quoted context omitted.

When you have non-standard characters in your name you quickly learn to never use them in computers since even though most systems works fine, some don't. And you can't fix all the thousands of systems your name has to interact with. I even had trouble booking flight tickets since their security system couldn't parse my name, and then had to go through some special security check due to it returning errors. After tha…

They're not non-standard characters. They're just as much a part of the Polish alphabet as 'a' and 'b' are.

That is exactly what I meant. My name doesn't have non-standard characters either from the perspective of my home country, it is just normal letters in the alphabet, but not in the English alphabet.
Post reply on HN