Sylvain
Sylvain

Reputation: 19279

how to use accented characters in jquery?

I have two problems that probably have the same root cause and the same solution:


If I execute this code:

$("i").replaceInText("text1", "étrange");

I get �trange instead of étrange.


If I execute this code

$("i").replaceInText("étrange", "text1");

it does not find the étrange


What am I doing wrong?

Upvotes: 2

Views: 2386

Answers (3)

gabrielstuff
gabrielstuff

Reputation: 1306

I guess you should check your encoded-file type. You should set it to UTF-8 if you want to use accent. Generally, you should use UTF-8 :)

Upvotes: 0

John Hartsock
John Hartsock

Reputation: 86902

try this

$("i").replaceInText("text1", "ètrange");

Upvotes: 0

awm
awm

Reputation: 6580

It appears that your .js file is not encoded in utf-8.

Upvotes: 3

Related Questions