Solved

JSON object ok, but then UTF-8 characters fail

Posted on 2013-11-06
3
554 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

630 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