Closed EgoBrainProgrammer closed 4 years ago
I believe this is due to the RCON protocol only utilizing ASCII, so it might be I can't do anything about it. Is there a different library or tool that's capable of handling cyrillic?
Of course have. Check it out. https://github.com/marceldev89/BattleNET This library can to handle cyrillic. But i have issues with connection to the server in DOTNET CORE. But your library has connection fine in DOT NET CORE.
I see, please try the latest dev branch commit d382e4fc45794b4bdbe57c6786b55416f40a4dd8
I see, please try the latest dev branch commit d382e4f
Hi. I am using your library from nuget. How to do update and get last commit?
PM> Update-Package BytexDigital.BattlEye.Rcon No package updates are available from the current package source for project
Please compile release version and public it on NuGet.
Ok. F... the NuGet. I just pull your dev branch and include sources to my solution. So getting this error:
Unhandled exception. System.NotSupportedException: No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
You can find the pre-release build here https://www.nuget.org/packages/BytexDigital.BattlEye.Rcon/1.0.2-beta.1
I solve 1251 issue. I am suggest you to use UTF8Encoding class instead Encoding.
` using System.Text;
namespace BytexDigital.BattlEye.Rcon { public class StringEncoder { //private readonly Encoding _encoding = Encoding.GetEncoding(1252); private readonly UTF8Encoding utf8string = new UTF8Encoding();
//public byte[] GetBytes(string message) => _encoding.GetBytes(message);
//public string GetString(byte[] bytes) => _encoding.GetString(bytes);
public byte[] GetBytes(string message) => utf8string.GetBytes(message);
public string GetString(byte[] bytes) => utf8string.GetString(bytes);
}
} `
This code works. Tested with cyrillic and chinese.
You can now use the nuget beta build https://www.nuget.org/packages/BytexDigital.BattlEye.Rcon/1.0.2-beta.2
The library do not support cyrillic symbols.