1

This is the result when I enter a Turkish character in span with innerHTML.The result is like this, "�r�n Favorilere Eklendi"

<a href="javascript:;" onclick="Main.AddRemoveFavorite(this)" id="true" data-favoriteid="@Model.product.FavoriteId">
<i id="icon" style="font-size:1.2rem; color:#798499;" class="icon-star"></i>
<span id="text" style="font-size:1rem; font-weight:400; color:#798499;cursor:pointer;">Ürünü Favorilerime Ekle</span>
</a>
document.getElementById("icon").className = "icon-star_alt"
document.getElementById("text").innerHTML = 'Ürün Favorilere Eklendi';
$(btn).data('favoriteid', data)
emeksc1
  • 43
  • 9

2 Answers2

1

Are you using meta tag inside your head

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

You can also check that HTTP server headers are there, because if they are present then the meta tag is ignored by browsers

the header:

Content-Type: text/html; charset=utf-8
Fareed Khan
  • 2,613
  • 1
  • 11
  • 19
1

The problem was solved by converting the file to utf-8.

emeksc1
  • 43
  • 9