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

  • Home
  • SEARCH
  • 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 7684797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:06:36+00:00 2026-05-31T19:06:36+00:00

When decoding/encoding a utf8 string using json_encode/json_decode I do not get back the string

  • 0

When decoding/encoding a utf8 string using json_encode/json_decode I do not get back the string in the original encoding…

$test = '{"c":"limón"}';

echo $test;                           //=> {"c":"limón"}    
echo json_decode($test)->{"c"};       //=> limón
echo json_encode(json_decode($test)); //=> {"c":"lim\u00f3n"}

How can I encode the string back to its original encoding (utf8)?

  • 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-31T19:06:37+00:00Added an answer on May 31, 2026 at 7:06 pm

    The default behavior of json_encode is to escape all Unicode characters. If your PHP is version 5.4.0 or greater, you can pass JSON_UNESCAPED_UNICODE as the second parameter of json_encode to get the behavior you’re expecting. There are numerous hacks to get this behavior in earlier versions, including preprocessing your object to encode Unicode characters as HTML entities, then reversing the transformation afterwards.

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

Sidebar

Related Questions

i am using Encoding and decoding : For Encoding: private string EncodeServerName(string ServerName) {
I'm creating a link shortening service and I'm using base64 encoding/decoding of an incremented
Does Python have a built-in, simple way of encoding/decoding strings using a password? Something
I am using this encoding/decoding javascript 64bit from here http://www.webtoolkit.info/javascript-base64.html so here is the
I'm wondering about MP3 decoding/encoding, and I was hoping to pull this off in
I am reading up about Encoding and Decoding and I noticed that sometimes people
Are there methods for encoding and decoding XML in .NET? I can't seem to
Is there any specific algorithm for the encoding and decoding MD5. Kindly give me
Can someone please redirect me to some good references about the encoding and decoding
Information theory comes into play where ever encoding & decoding is present. For example:

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.