문제

I'm using JavaScript to get the elements under the clicked elements in my website. And I'm sending the content to server side.

But some times, I'm getting some invalid characters like: â€, â–º, etc.

What is the reason for this? And how to correct it?

도움이 되었습니까?

해결책

†looks like utf-8 being misinterpreted as Windows-1252. Try setting the encoding for your pages:

<?php
header( "Content-Type: text/html; charset=utf-8");

or if you prefer in .htaccess file:

AddDefaultCharset UTF-8

다른 팁

Sometimes characters such as ' " , . / \ ; : & % $ # @ * (basically all symbols) and others are formatted differently if they are copied from another location. Go though and replace all punctuation and other symbols with themselves and those weird characters should go away.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top