Click here to Skip to main content
15,886,110 members

Comments by Marc A. Brown (Top 200 by date)

Marc A. Brown 18-Apr-14 10:19am View    
Nice solution. Thanks! This is what I was searching for yesterday but couldn't find.
Marc A. Brown 18-Apr-14 10:18am View    
And now I feel like a complete idiot. Digging back to my parent class I see that I *did* inherit from Component. I have no idea why I would've done so and since it's library code I'm fearful of changing it (removing Component and implementing IDisposable) because I'm not sure that doing so wouldn't create breaking changes in projects that use it (not all of which are mine). In any event, I tested your solution and it does work (as does the solution below from Alan).
Thanks!
Marc A. Brown 17-Apr-14 17:46pm View    
None of which answers the question. There's either a way to do it or there isn't. Whether nonvisual components are a good idea or not is immaterial. If what I'm doing involves extending a class that implements IComponent, I can't really help that it's a Component, I would just like to determine whether there's a solution to my issue (which is admittedly a matter of convenience rather than necessity).
Marc A. Brown 21-Jun-13 11:22am View    
Sergey,
Ah, so *you* were the phantom. :) As I said above, I'm not concerned about the 1-vote for myself but for someone else looking for a solution that appears to have (mostly) worked for the OP. Thanks for the explanation -- that's very helpful.
I actually already knew, from poking around for a solution, that a UTF-8 "string" is actually a sequence of bytes rather than a string. Now in looking at it further, it would appear that you're correct that, with the exception of characters that correspond to ASCII, this solution fail. It would seem that a proper solution would require a bit-wise reading of the first byte of data to determine the number of bytes for each character, then reading that number of bytes, then repeating until the entire source was read.
Simpler would be to declare me emperor of the world and I'll outlaw non-English languages. ;)
--mab
Marc A. Brown 21-Jun-13 9:12am View    
Perhaps so but taking him at his word that it is UTF-8, how're the proposed solutions? :)
And it would appear that there's a phantom univoter about. My solution got univoted by someone with fairly high rep, but without comment. I'm not concerned about my rep points but if my answer is right (or at least close, and the OP's comment to my solution indicates that it is), it sucks to see it downvoted since anyone else searching for a solution to the same issue may discount the solution because of that.