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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:21:45+00:00 2026-06-16T01:21:45+00:00

I’ve been searching around for like 3 hours and I know there are a

  • 0

I’ve been searching around for like 3 hours and I know there are a lot of questions like this one that have already been asked, but I haven’t found any solution that works for me with my problem when trying to output accented characters of the result by a SELECT query on my database.

 $itemsList = array();
 while($row = mysql_fetch_assoc($res)){
    $itemsList[Items][] = ($row);
 }
 echo json_encode($itemsList);

This will output :

{"Items":  [

{"user_name":"misterP", 

"comment":"\u00c3\u00a9t\u00c3\u00a9",

"image_name":"403885300736874.jpg"}]}

But I need to output the accents, like this :

{"Items":  [

{"user_name":"misterP", 

"comment":"été",

"image_name":"403885300736874.jpg"}]}
  • My database and tables have interclassement utf8_general_ci
  • The datas inserted in my database are utf8_encoded
  • my php script is in Unicode (UTF-8)
  • I did ” mysql_set_charset( ‘utf8’ ); ” before the SELECT on my database
  • If this can help someone : in y database, the word “été” is : “été”

So I really don’t know what to do now, I am really stuck with the accents and i can’t get it work. Thanks in advance !

  • 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-16T01:21:46+00:00Added an answer on June 16, 2026 at 1:21 am

    That doesn’t really matter. When the json is decoded, they become characters again.

    If you use php 5.4 >=, you can pass JSON_UNESCAPED_UNICODE to json_encode:

    json_encode( $data, JSON_UNESCAPED_UNICODE )
    

    But again, the unicode escapes work just as well and make the data ascii safe.

    Edit:

    It looks like your data was already screwed, even before json_encode. You have “double encoded” it as utf-8 it seems.

    The datas inserted in my database are utf8_encoded

    Are you using something like utf8_encode? You do not need to do anything in your code when you insert into your database. If you inserted the data in the database using utf8_encode, then that explains the double encoding. All you need is for the data to be utf-8 and have mysql_set_charset( 'utf8' ) before inserting.


    It is interesting to know that if your json has unescaped unicode, the json cannot be executed as javascript even if you add parentheses if the json contains U+2028 or U+2029.

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

Sidebar

Related Questions

I know there's a lot of other questions out there that deal with this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.