C
Join ServerC#
help
SuperSocket utf-8 encode problems [Answered]
Zzonedetec9/18/2022
Hey guys it's me again
I have a superSocket server, and I send message to the server using this :
as you can see there is a "Encoding.UTF8".
So now if I check what have been received by the server :
"a super ?? message"
So the "ç" become a "??".
I don't know how to fix that knowing that I can do nothing between the time I send the message and the time my server receive it.
One thing I thing really important : on the "appServer" variable (the variable that fire the event to receive messages) there is a parameter .TextEncoding, but I have no idea how to use it because he is read only and have a lot of sub parameter
I have a superSocket server, and I send message to the server using this :
internal void Send(string str)
{
// [APP NAME] id > message
var buffter = Encoding.UTF8.GetBytes("a super ç message\r\n");
var temp = SocketClient.Send(buffter);
}
as you can see there is a "Encoding.UTF8".
So now if I check what have been received by the server :
"a super ?? message"
So the "ç" become a "??".
I don't know how to fix that knowing that I can do nothing between the time I send the message and the time my server receive it.
One thing I thing really important : on the "appServer" variable (the variable that fire the event to receive messages) there is a parameter .TextEncoding, but I have no idea how to use it because he is read only and have a lot of sub parameter


Ccanton79/18/2022
I've never used SuperSocket, but googling "SuperSocket Encoding" gives this page: https://docs.supersocket.net/v1-6/en-us/supersocket-basic-configuration . Have you set the
textEncoding
setting documented there?Zzonedetec9/18/2022
I did set a config file with "textEncoding="UTF-8" but nothing change, maybe I'm doing it wrong

Zzonedetec9/18/2022
nvm I maked it work!
Zzonedetec9/18/2022
Here's how I did :
appServer = new AppServer();
var m_Config = new ServerConfig
{
Port = 30776,
Ip = "Any",
MaxConnectionNumber = 99999,
Mode = SocketMode.Tcp,
Name = "zonedetecServer",
TextEncoding = "UTF-8"
};
//Setup the appServer
if (!appServer.Setup(m_Config))//Setup with listening port
{
Console.WriteLine("Failed to setup!");
Console.ReadKey();
return;
}
AAccord9/18/2022
✅ This post has been marked as answered!