Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:15:51+00:00 2026-06-14T18:15:51+00:00

I am sending a text México D.F. from javascript to C# but i am

  • 0

I am sending a text México D.F. from javascript to C# but i am getting M??xico D.F..
My C# code is below.

public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
{
     System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
     string PostbackData = enc.GetString(context.Request.BinaryRead(context.Request.TotalBytes));
}

PostbackData contains México D.F. text as M??xico D.F..
How can i resolve it. Please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:15:53+00:00Added an answer on June 14, 2026 at 6:15 pm

    You shouldn’t use ASCII, as there is no such symbol é there, so use Encoding.UTF8 instead:

    using System.Text;
    
    public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
    {
         //System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
         string postbackData = Encoding.UTF8.GetString(context.Request.BinaryRead(context.Request.TotalBytes));
    }
    

    Edit, as John Skeet mentioned: You can use Encoding from your request rather than try to guess it – sometimes even UTF-8 is not enough, so better approach is:

    using System.Text;
    
    public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
    {
         //System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
         string postbackData = context.Request.ContentEncoding.GetString(context.Request.BinaryRead(context.Request.TotalBytes));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

sending text to label and number to int from tabelview to viewcontroller but it
Hi Is there any way to block my iPhone from calling/sending text to a
I am getting this error Uncaught SyntaxError: Unexpected token < from chrome but everything
I'm getting data from servlet and my sysout of json object which i'm sending
I have this javascript code, from google charts api right in the bottom of
Here is my code in php for sending sms if(isset($_POST['frmType'])&& $_POST['frmType'] == guest_mail){ $from
I've used ColdFusion for sending text emails for years. I'm now interested in learning
I am sending password text to the http service request object.like <request><password>pass.text</password></request> now this
I'm sending a large amount of text to my webpage by POST that's received
I am sending UTF-8, japanese text, to my server. It works in Firefox. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.