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 972923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:12:03+00:00 2026-05-16T03:12:03+00:00

My problem is. I’m sending values to Generic Handler via Ajax like that way.

  • 0

My problem is.

I’m sending values to Generic Handler via Ajax like that way.

xmlHttpReq.open("GET", "AddMessage.ashx?" + (new Date().getTime()) +"&Message=" + encodeURIComponent(Message), true);

when message contains İ,ç,ö,ğ,ü,ı they are looking like that on Handler İ,ç,ö,Ä,ü,ı

I write this in AddMessage.ashx Handler

    context.Request.ContentEncoding = System.Text.Encoding.UTF8;
    context.Response.ContentEncoding = System.Text.Encoding.UTF8;

Also i write this on MasterPage and Aspx page

    Response.ContentEncoding = System.Text.Encoding.UTF8;
    Request.ContentEncoding = System.Text.Encoding.UTF8;

But its doesn’t make any sense.

  • 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-05-16T03:12:04+00:00Added an answer on May 16, 2026 at 3:12 am

    I believe that your the error lies in an encoding mismatch between your browser your server. If the browser assumes your page is encoded in latin-1 (or more correctly iso-8859-1) the result of the encodeURIComponent for the letter ‘ü’ will be ‘%u00c3%u00bc’ which when interpreted as UTF-8 on the server will be decoded as ü.

    You shouldn’t hardcode encodings unless you’re absolutely sure of what you’re doing. Try to remove some or all of your custom encoding code and see if you can get it to work then.

    I set up a blank ASP.NET Web Application to see if I could replicate your problem.

    WebForm1.aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script>
                var client = new XMLHttpRequest();
                client.open('GET', 'Handler1.ashx?Message=' + encodeURIComponent('ü'));
                client.send();
        </script>
    </head>
    <body>
        åäö
    </body>
    </html>
    

    Looking at the decoded Request.QueryString[“Message”] in the debugger produced the expected result (ü).

    But If we trick the browser into thinking that the page is being transmitted in ISO-8859-1:

    using System;
    
    namespace WebApplication1 {
        public partial class WebForm1 : System.Web.UI.Page {
            protected void Page_Load(object sender, EventArgs e) {
                Response.ContentType = "text/html; charset=iso-8859-1";
            }
        }
    }
    

    The Request.QueryString[“Message”] now contains “ü”. And the browser can’t properly render the åäö string in the body.

    Have a look using some web debugging tool like fiddler or firebug to determine what encoding the server actually uses to transmit contents and what encoding the browser believes it’s receiving.

    If the contents for the ‘Message’ variable is received from another AJAX request you should check to make sure that you’re using a proper encoding to transmit that content as well.

    Bottom line, don’t bother to much about encodings. Not doing anything will, most of the time, be the right thing to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have a table that prints out vertical but I would like it
Problem is like this: I have two winapi application's. There is only one way
Problem: I have a WCF service that invokes methods via reflection and sends the
Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes
Problem: I have code that looks for a file and open it. By default
Problem: Been struggling to get my code to load external shaders and it is
Problem occured when i tried to display xml data that has been taken by
Problem: I'm working on a website where there is a dial that displays a
Problem: I have 2 classes, DB class and a User class, that will work
Problem is like this: Suppose there are records in dataTable with FruitType as A

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.