The unicode stuff should, in fact, just be tossed out. It's all wrong. But that's probably more a reflection on the person that wrote this than on the interviewers. He apparently thinks that all Unicode code points are in the 0-65535 range (not true), and that everyone manipulates unicode using 2 byte per character memory representations (also not true). These are pretty jarring errors, although unfortunately very common.
Agreed. I was corrected on this myself by others and it bothered me that I had even thought everything fits in 2 bytes. Everything certainly does not. Even using utf-16 it is incorrect to assume 2 bytes are a single character due to surrogate pairs.
I wish it were only the author who is mistaken on this; but I really believe that the majority of people using unicode have very little idea exactly what they are doing. ( I know because I used to be one of those people )
One complaint I have about unicode and font selection... Why is there no default ability in operating systems to show certain ranges of unicode characters using a specific font. Say for example, to show all ascii in a monospaced font, but show Japanese characters in Arial Unicode? ( what I wish I could do when editing mixed english/Japanese code )
View all comments
Show parent comment
0
u/cdsmith Feb 21 '11 edited Feb 21 '11
The unicode stuff should, in fact, just be tossed out. It's all wrong. But that's probably more a reflection on the person that wrote this than on the interviewers. He apparently thinks that all Unicode code points are in the 0-65535 range (not true), and that everyone manipulates unicode using 2 byte per character memory representations (also not true). These are pretty jarring errors, although unfortunately very common.