Arabic Language !!

05/12/2012 19:31 magnon#1
i'm asking if i can make NPC Talk With Arabic Language please
05/12/2012 19:40 CptSky#2
Quote:
Originally Posted by magnon View Post
i'm asking if i can make NPC Talk With Arabic Language please
CO2 uses CP1252 by default. But, it is probably possible to set the locale to CP1256 (Windows Arabic Code Page). So, I would say yes.

CP1256 doesn't seems to be really complete (I don't know arabic, so I can't really say). If you need UNICODE to have a full arabic set, it will be impossible to set the locale to UTF-8.
05/12/2012 19:48 magnon#3
Code:
 public string Text {
            get { return Encoding.UTF7.GetString(Buffer, 14, Buffer[13]); }
            set {
                int realloc = value.Length + 8 + 17;
                if (realloc != Buffer.Length) {
                    byte[] new_Packet = new byte[realloc];
                    System.Buffer.BlockCopy(Buffer, 0, new_Packet, 0, 24);
                    Buffer = new_Packet;
                }
                WriteUInt16((ushort)(value.Length + 17), 0, Buffer);
                WriteStringWithLength(value[#59687
how to Encoding this for Arabic
05/12/2012 20:01 dego4ever#4
yes _ but with ar client 'Qahr'
05/12/2012 20:10 magnon#5
Quote:
Originally Posted by dego4ever View Post
yes _ but with ar client 'Qahr'
Yes i have Arabic Clint
05/12/2012 20:24 dego4ever#6
then try to use this

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)
            {
                var bytes = Encoding.Default.GetBytes(arg);
                {
                    ushort i = 0;
                    while (i < arg.Length)
                    {
                        buffer[(ushort)(i + offset)] = bytes[i];
                        i = (ushort)(i + 1);
                    }
                }
            }
        }
& if u will get strings from sql db, don't forget to make charset = "utf8"
05/12/2012 20:33 magnon#7
Quote:
Originally Posted by dego4ever View Post
then try to use this

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)
            {
                var bytes = Encoding.Default.GetBytes(arg);
                {
                    ushort i = 0;
                    while (i < arg.Length)
                    {
                        buffer[(ushort)(i + offset)] = bytes[i];
                        i = (ushort)(i + 1);
                    }
                }
            }
        }
& if u will get strings from sql db, don't forget to set charset to "utf8"
Encoding.utf7 work on chat but not work on NPC
05/12/2012 20:50 dego4ever#8
you write packet not read, :)
05/12/2012 20:54 magnon#9
Then how can i do:(
05/12/2012 21:16 dego4ever#10
go to "WriteStringWithLength" void or
search for "
Code:
public static void WriteStringWithLength(string arg, int offset, byte[] buffer)
"

and replace with this

Code:
public static void WriteStringWithLength(string arg, int offset, byte[] buffer)
        {
            if (buffer == null)
                return;
            if (offset > buffer.Length - 1)
                return;
            int till = buffer.Length - offset;
            till = Math.Min(arg.Length, till);
            buffer[offset] = (byte)arg.Length;
            offset++;
            ushort i = 0;
            var bytes = Encoding.Default.GetBytes(arg);
            while (i < till)
            {
                buffer[(ushort)(i + offset)] = bytes[i];
                i = (ushort)(i + 1);
            }
        }
and it will be ok
05/12/2012 21:23 2slam#11
how about using Qahr client just get ur dll files and Conquer.exe and run ur server
05/12/2012 21:26 magnon#12
Oh thank you alot for your help but broadCast not Work :)

Oh thank you alot for your help it's work now but broadcast not work:)

Quote:
Originally Posted by 2slam View Post
how about using Qahr client just get ur dll files and Conquer.exe and run ur server
Thanks 2sllam for your help it's work now :):handsdown: thx ya gamel