Thanks for the comments! I'm all for improved readability. I definitely wasn't aiming for much performance wise, at least initially. These were two areas (of many) that I felt could do with some improvement (especially the file IO). I will look into making some modifications like those suggested when I get a chance.
I guess I've just been assuming any Roman characters are English, some definitely might be Pinyin. I generally try not to stare at peoples screens for too long haha.
I did an intro to Chinese (Mandarin) class a few years ago so I'm aware of Pinyin but have forgotten almost everything (except some of the bits I found particularly interesting like word order for times and places, how numbers are represented and a few other things).
In Hong Kong, I sometimes see peoples screens when I'm using public transport. WhatsApp audio recordings are very popular, sometimes I can see the entire conversation is just audio recordings back and forth. Other times it's Chinese (I can't differentiate which), sometimes English, often a mix. I've only seen someone drawing characters with his finger once.
Actually organising the write up forced me to tidy up the code much more than I otherwise would have. I definitely find C# to be one of the more readable languages although I have had to debug and untangle some C# messes before.
Yeah I remember changing it to a SortedDictionary but I changed it back. I can't remember exactly why, possibly because it's supposed to be sorted by raw UTF8 bytes rather than a nice neat C# string and I didn't want to start using byte arrays for dictionary keys. I guess it only needs to be sorted when in the BEncoding format and it felt better to keep the internal structure as simple as possible. The tradeoff is it doesn't support incorrectly encoded torrent files – I'm really not sure how much of an issue that is.
I recently went through the same thing – building my own simple BitTorrent client, mostly just due to curiosity about how the protocol works. There were some tricky parts, most of which are outlined in this but I found the underlying concept so simple. I guess simplicity is a requirement for scale and resilience.