Solved

JSON object ok, but then UTF-8 characters fail

Posted on 2013-11-06
3
543 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

680 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