Is json data garbled in non-UTF-8 encoding? Authority

Source: Internet
Author: User
Is json data garbled in non-UTF-8 encoding? Authority said that json data in non-UTF-8 encoding will be garbled? Authority


Reply to discussion (solution)

It won't be the same as the encoding of your file.

Therefore, the json_encode () parameter must be UTF-8 encoded. otherwise, null or null is obtained.

No, it's just a text, but it's hard to say it's generated by a program. encoding and decoding depend on the json control's capabilities.

This depends on the data content in your JSON data. if it contains content in a few languages, it will also contain garbled characters. Even the content with double quotation marks is garbled. I have met before.

Encoding is required when passing parameters. I remember what you said.

Garbled text is only subjective.
When you watch the UTF-8 Content in the gbk environment, the gbk content in the UTF-8 environment, and the Chinese content in the Spanish environment, you can see some unfamiliar symbols, so you can see garbled characters. But in fact, the content should be displayed in these environments, but you don't know it.

Therefore, if you want to show some texts to the public, you need to use the context that suits the public. Instead of letting the public adapt to you

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.