Quote:
Originally Posted by abdoumatrix
try using default encoding when writingstring in packet
PHP Code:
public static void WriteString(string arg, int offset, byte[] buffer) { if (buffer == null) return; if (offset > buffer.Length - 1) return; byte[] argEncoded = Program.Encoding.GetBytes(arg); if (buffer.Length >= offset + arg.Length) Array.Copy(argEncoded, 0, buffer, offset, arg.Length); }
and use default instead of utf7
|
1st of all thanks for ur answer
2nd i have to replay that void ?
my void like that
PHP Code:
public static void WriteString(string arg, int offset, byte[] buffer)
{
if (buffer == null)
{
return;
}
if (offset > buffer.Length - 1)
{
return;
}
if (buffer.Length >= offset + arg.Length)
{
unsafe
{
#if UNSAFE
fixed (byte* Buffer = buffer)
{
ushort i = 0;
while (i < arg.Length)
{
*((byte*)(Buffer + offset + i)) = (byte)arg[i];
i++;
}
}
#else
ushort i = 0;
while (i < arg.Length)
{
buffer[(ushort)(i + offset)] = (byte)arg[i];
i = (ushort)(i + 1);
}
#endif
}
}
}
i have to replace it b4 i try with with default encoding ?