Arabic words not getting inserted into tally RRS feed

  • Question

  • User-19205220 posted

    I am trying to insert data into tally, my code is as below. I am not able to insert arabic value into tally, shows some junk notations instred of arabic text. Is there any other unicode format I need to use

    byte[] tally_req = Encoding.UTF8.GetBytes(Req_builder.ToString());
    var http = WebRequest.Create(txtTallyConnection.Text) as HttpWebRequest;
    var cache_policy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
    http.CachePolicy = cache_policy;
    http.Method = "POST";
    http.ContentLength = tally_req.Length;
    http.ContentType = "text/xml ; encoding =UTF-8?";

    using (var write_request_stream = http.GetRequestStream())
    write_request_stream.Write(tally_req, 0, tally_req.Length);
    using (var tally_reponse = http.GetResponse() as HttpWebResponse)
    using (var tally_response_reader = new StreamReader(tally_reponse.GetResponseStream()))
    Response = tally_response_reader.ReadToEnd();

    Friday, July 3, 2020 7:26 AM

All replies

  • User1535942433 posted

    Hi anupalavila,

    As far as I think,you could try this:

    HttpWebRequest request=(HttpWebRequest)WebRequest.Create("http://www.yourdomain.com");
    request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1);Accept-Language:ar"

    Or you could try:

    Byte[] encodedBytes = System.Text.Encoding.GetEncoding(1256).GetBytes(s);

    Best regards,

    Yijing Sun

    Monday, July 6, 2020 7:05 AM