Closed DeathByNukes closed 9 years ago
Can you give an example how this would screw up the parser. I can"t come up with something...
When IrcConnection.Encoding == Encoding.UTF8 and someone sends a message starting with unicode character \u0307 (alt+775 in mIRC), e.Data.Message in the corresponding OnChannelMessage event will be null.
Notice the mark above the colon in this image.
I see what the parser did in your screenshot but I am unable to reproduce this myself. Maybe Mono behaves differently in this regard...
Maybe so...
Either way, I don't see a reason to reject this change. I assure you it works; I've been running this version almost a year now with no problems. Ordinal comparisons are more efficient and I assume they are truer to the IRC standard. (they compare the bytes directly with no fancy logic)
I am not merging arbitrary changes for unreproducible issues. I need at least a test-case that fails on Mono or .NET while it should work (like your screenshot suggests). If this matter is true, then ALL uses of IndexOf and possibly other string methods need to be changed for protocol message parsing.
Unreproducible? It sounded like you only attempted to reproduce it in Mono then gave up. Do you need more information?
Yes exactly, I don't have .NET anywhere handy :) I will merge this fix anyhow since your screenshot clearly shows the bug. Thanks for finding and fixing this!
Fixes a bug where messages starting with "combining" Unicode characters cause the parser to fail. Likely improves performance too.