i make web service in c# which write with HTTP RESPONE.WRITE json answer but the problem is when i return the json with some field which included the hebrew langauge , after that the json response is not full the end bracket miss.. i put the code in c# and the response of the json string

json response with hebrew fields


json response regulat with english fields :


and thie my code in web service this the model of the json response

public class Android_Reg
    public string Response { get; set; }
    public string FName { get; set; }
    public string LName { get; set; }
    public string User_Name { get; set; }

    public string ErrorMsg { get; set; }   

string l = Convert.ToString(jSon.Serialize(reg).ToString().Length);
string jsonr = jSon.Serialize(reg).ToString();
var json = JsonConvert.SerializeObject(reg, Formatting.Indented);
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Charset = "utf-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/json";
HttpContext.Current.Response.AddHeader("content-length", l);


thank you for help :)

Related posts

Recent Viewed