tf2_bot_detector icon indicating copy to clipboard operation
tf2_bot_detector copied to clipboard

[BUG] Custom chat_<language>.txt files can be changed to UTF-8 causing crashes

Open andy013 opened this issue 4 years ago • 0 comments

Sometimes chat_<language>.txt files within the custom folders get changed to UTF-8 encoding. This will cause the bot detector to crash on opening. I'm not sure if it's TF2 that is changing the encoding or the bot detector or something else.

To reproduce you can just put a chat_english.txt file in tf/custom/my_mod/resource and make sure it's saved as UTF-8.

I think it might be this part of the code that is causing the crash by failing to check the file encoding is correct:

https://github.com/PazerOP/tf2_bot_detector/blob/881f0cefdef3a9281f3a5297cdc30c3e0cb1875d/tf2_bot_detector/Config/ChatWrappers.cpp#L381-L382

Why the files are changing to UTF-8, I have no idea. I thought it might have been when the bot detector crashed in the middle of accessing the file but I checked my logs and it seems like I had a graceful shut down right before it happened.

andy013 avatar Apr 29 '21 04:04 andy013