Welcome everyone
Have a big problem in the end this code
This code works with one of the chat games networks
But it does not appear the Arabic letters
But appear in this form
????????????
While the characters appear as English is
How can I deal with this situation
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Threading;
using System.Text;
using System.IO;
namespace ConquerSx.PacketHandling
{
public class Chat
{
public static void Handle(Main.GameClient GC, byte[] Data)
{
MemoryStream MS = new MemoryStream(Data);
BinaryReader BR = new BinaryReader(MS);
BR.ReadBytes(8);
ushort ChatType = (ushort)BR.ReadUInt32();
BR.ReadBytes(13);
string From = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte()));
string To = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte()));
BR.ReadByte();
string Message = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte()));
BR.Close();
MS.Close();
#region BadWords
Message = Message.Replace("http:/", "****");
Message = Message.Replace(".net", "****");
Message = Message.Replace(".com", "****");
Message = Message.Replace(".tk", "****");
Message = Message.Replace("www", "****");
Message = Message.Replace("damn", "****");
Message = Message.Replace("fuck", "****");
Message = Message.Replace("shit", "****");
Message = Message.Replace("stupid", "******");
Message = Message.Replace("wtf", "***");
Message = Message.Replace("idiot", "*****");
Message = Message.Replace("fucker", "******");
#endregion
if (ChatType == 2104 && GC.MyChar.MyShop != null)
GC.MyChar.MyShop.Hawk = Message;
try
{
if (Message[0] == '/')
{
string[] Cmd = Message.Split(' ');
if (Cmd[0] == "/players")
{
GC.LocalMessage(2000, "Players Online: " + Game.World.H_Chars.Count);
string eMsg = "";
foreach (Game.Character C in Game.World.H_Chars.Values)
eMsg += C.Name + ", ";
if (eMsg.Length > 1)
eMsg = eMsg.Remove(eMsg.Length - 2, 2);
GC.LocalMessage(2000, eMsg);
}
and other lines are ok
just those