Solved

JSON object ok, but then UTF-8 characters fail

Posted on 2013-11-06
3
537 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
Comment Utility
please provide a link
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now