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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:22:16+00:00 2026-05-22T17:22:16+00:00

I am having an admin module and a front end module. I have a

  • 0

I am having an admin module and a front end module.

I have a category section.

I create categories by posting the value from the text box to php through ajax.
Both admin and front end charset is utf-8.

I read that by default ajax use utf-8 encoding.

while i post the data it is saved in the database perfectly.

I can see that unicode text in the database.

as well as i can see it while listing in the admin and in the front end.

BUT

when i click edit what i do is i fetch the data from the server using ajax/json

what i get is just ????? instead of the unicode text.

Where as in normal loading it is displayed well.

What could be the problem… what i am missing?


Edit

var jax = createAjax();
jax.open("POST",path,true)  
jax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
jax.onreadystatechange = afunction;

here is the php code

$query = "select * from $box where id=$id";
if(! ($res = mysql_query($query)))die(mysql_error());
$rs = mysql_fetch_array($res,1);
$rs['status'] = 1;
header("Content-Type: text/html; charset=utf-8");
die(json_encode($rs));

i have used the above for both request and response… even i have changed utf-8 to iso-85**-1 some thing that default but no effect.

i have attached the screen shots below
Open the images in new window or tab to see it bigger
enter image description here

in the above image you can see the utf char is displayed well in the listing but when edited ussing ajax and json it is dislayed as ???? in the text box.

enter image description here

and here is how the text appears in the db…
enter image description here

  • 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-22T17:22:17+00:00Added an answer on May 22, 2026 at 5:22 pm
    SET NAMES 'utf8' COLLATE 'utf8_general_ci'
    

    this helped me over come that problem.

    execute this query after you made the connection.

    i got this information form code igniter framework because using that my code work working well but when i used mysql_query directly i couldnt get expected result.

    if you are using code igniter then this is made by default else you have to do include that line.

    I am not accepting this as my own answer because there might be some more reasons that could be posted by users so i am waiting for more comments and answers for this question.

    anyway it is working now.

    Besides, make sure that the table collation is utf8, and the field is also that.

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

Sidebar

Related Questions

Under MacOSX, I can create a file under root (/) without having admin rights.
Having a string with the module and name of a class, like: Admin::MetaDatasController how
In the transition to newforms admin I'm having difficulty figuring out how specify core=False
I am having issues with javascript functionality not working in the admin area. When
I'm having trouble getting django-admin.py to work... it's in this first location: /Users/mycomp/bin/ but
I'm having a hard time understanding how the CakePHP admin system works. Should all
Having problems with IE8... I have a button that onclick fires the showImageBrowser() function.
I am using django and I have a file named models.admin.py and I want
Assume we create 3-tier module, which enables us to display/create/edit articles. Articles are: •
So having such json: { config: { name: myconfig, servecies: { module: [ file,

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.