Solved

JSON object ok, but then UTF-8 characters fail

Posted on 2013-11-06
3
541 Views
Last Modified: 2013-11-25
I have a JSON object that looks ok in the browser (chrome with utf-8 "mode").

When I use the web-application it seems that the javascript mess up the UTF-8 characters and i get a questionmark with a whitish diamond surrounding it.

What do I need to do in the javascript to handle a json object correctly regarding encoding?
0
Comment
Question by:mdoland
3 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39627060
please provide a link
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39627114
Is the character messed up when it comes back from your request, or just when you inject it into the DOM?

You need to make sure your HTML page has a valid character set, i.e. utf-8. In the head of your page, make sure you have this:

<meta charset="utf-8">
0
 

Author Comment

by:mdoland
ID: 39627363
I have <meta charset="utf-8"> in myhtml files. I still investigate where the error seems to happen. When I do a get on the URL that returns the JSON, it looks fine.

I will get back when I know more.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question