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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:49:36+00:00 2026-05-28T05:49:36+00:00

Why does this: <? var_dump ( json_decode(‘{unicode:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8}’) ); ?> give me: object(stdClass)#1 (1) {

  • 0

Why does this:

<?
var_dump ( json_decode('{"unicode":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8"}') );
?>

give me:

object(stdClass)#1 (1) {
  ["unicode"]=>
  string(18) "ãã¬ã¹ã­ãã"
}

when according to the docs it should be “プレスキット”

This happens to me on one machine running PHP 5.1.6 with this module installed as per the instructions on http://www.aurore.net/projects/php-json/ and on a machine running PHP 5.2.11

  • 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-28T05:49:37+00:00Added an answer on May 28, 2026 at 5:49 am

    You need to let the browser know to interpret the data as UTF-8 by sending an HTTP header prior to outputting the actual JSON like so:

    header(‘Content-Type: application/json; charset=utf-8’);

    Note that headers must be sent before any other output. You should probably read up on the HTTP spec and learn about how headers are used. Here’s a link to get you started with sending HTTP headers in PHP.


    UPDATE

    In an instance like this where the correct headers have been sent, it’s important to make sure the locale settings on your testing machine allow for UTF-8 characters. If the default locale on your system doesn’t support UTF-8 and you don’t have one installed that does, you’ll never see the correct output. You can read a little more about this here

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

Sidebar

Related Questions

Does anyone know why this happens? var_dump(json_decode(stripslashes(json_encode(array(O'Reiley))))); // array(1) { [0]=> string(8) O'Reiley }
I have a javascript that does this (http is your XMLHttpRequest object) var r
Why does this yield an empty set? Object[] types = {23, 234, hello, test,
This line: var_dump($data['department']); returns this: object(Penny\HomeBundle\Entity\Department)[1420] protected 'id' => int 37 protected 'name' =>
Why does this return an array instead of an object and how can I
When I var_dump an object, the output looks like this: object(XCTemplate)#2477 (4) { [id]=>
Does anyone know how to write this var q = from c in customers
Why does this code always return 0? var possibleMatches = new Array(); $.getJSON('getInformation.php', function(data)
why does this only alert 1 ? function test() { var myobj = {
Simple question - what does this actually do? var oq = (ObjectQuery<TEntity>)L2EQuery; return ExecuteFirstorDefault<TEntity>(oq,

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.