Quantcast
Channel: Unable to translate Unicode character
Viewing all articles
Browse latest Browse all 6

Unable to translate Unicode character

$
0
0

I have a ASP.NET Web API and a mobile app.

I monitor the Web Api with Newrelic and i see a lot of: "Unable to translate Unicode character \uD83C at index 237 to specified code page. "

A lot of users using the app have complained that it is not working properly and i think this is the problem.

This error occured when the users try to load a list of comments.

This is the function where the error occured:

 public HttpResponseMessage Comments(int UserNr)
    {
        try
        {
            List<Comment> Data = Comments.GetData(UserNr);
            return Request.CreateResponse(HttpStatusCode.OK, Data);
        }
        catch (Exception Ex)
        {
            var Nr = LogError(Ex);
            return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, string.Format("ErrorNr: {0}", Nr));
        }
    }

I have try this:

protected void Application_Start()
    {
        var OldDefault = GlobalConfiguration.Configuration.Formatters.JsonFormatter.SupportedEncodings[0];
        GlobalConfiguration.Configuration.Formatters.JsonFormatter.SupportedEncodings.Add(OldDefault);
        GlobalConfiguration.Configuration.Formatters.JsonFormatter.SupportedEncodings.RemoveAt(0);

        AreaRegistration.RegisterAllAreas();
        GlobalConfiguration.Configure(WebApiConfig.Register);
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }

But the error is still there. What can i do reduce/prevent this error?


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images