Mahendra
Mahendra

Reputation: 333

Swedish character issue

I have a requirement where we need to fetch data using ajax and display in drop down which may contain Swedish characters.

In IE Swedish characters are shown as square box, if i read it again using JavaScript it is showing as �

I have used encoding html content UTF8 as below.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

If i display same data or character on html page directly, it showing correctly. Problem occurs only when JavaScript comes into picture.

All inputs are appreciated.

Upvotes: 0

Views: 2091

Answers (2)

&#65533; is definitely not a Swedish character, but a special unicode codepoint that is used as replacement for a character whose value is unknown or unrepresentable in Unicode. What is likely happening is that your data is not being transmitted with the proper encoding indicated in its transmission header (or as part of the data, if it's marked up data).

Upvotes: 2

Rahul Tripathi
Rahul Tripathi

Reputation: 172568

You probably need this:

<meta http-equiv="content-type" content="text/html" charset="ISO-8859-1" />

Upvotes: 2

Related Questions