Question: When I execute the following code, it returns non-standard characters, so how do we remove it or get original string?

```
header('Content-type: text/html; charset=utf-8');
$String = "à¸?à¹ˆà¸­à¸•à¸±à¹‰à¸‡à¹€à¸¡à¸·à¹ˆà¸­";
echo $String;

```

Output : `�?่อตั้งเมื่อ`

Need actual result : `ก่อตั้งเมื่อ`

Answer: 
Your string, `à¸?à¹ˆà¸­à¸•à¸±à¹‰à¸‡à¹€à¸¡à¸·à¹ˆà¸­` is not valid utf-8. That is why the `�` shows up - the browser does not know how to interpret it.

As others have indicated, the question mark on the third position likely is the problem. 

The first three bytes of the erroneous string are `e0 b8 3f` (`3f` being the ascii code `?`). I do not know any Thai, but the byte sequence for a [THAI CHARACTER KO KAI](http://www.fileformat.info/info/unicode/char/0e01/index.htm) looks pretty similar and should be`e0 b8 81`.
First of all, to not be confused by encodings problem, you really want to read the following article: <http://kunststube.net/encoding/>

Second, I just have done the following:

```
$ vim ~/sandbox/php/encoding.php
( inserted your code verbatim )
$ cd ~/sandbox/php/
$ php -S localhost:1200

```

After I opened in Firefox the page <http://localhost:1200>, I got the contents of `$String` as they are.

I mean that I got the following line of chars:

```
à¸?à¹ˆà¸­à¸•à¸±à¹‰à¸‡à¹€à¸¡à¸·à¹ˆà¸­

```

This means your browser, whichever it is, does not know how to render the characters you are entering to it. The string itself is being encoded in UTF-8 correctly. You have to set your browser to show the text as UTF-8, or probably install the fonts which support those symbols.

Also, if you want to output, say some text with UTF-8 Devanagari symbols, you just need to satisfy the following requirements in PHP:

1. Your source code file must be saved in UTF-8.
2. You must send the utf-8 charset subheader, which you already do.
3. You must put the string you want to output to the browser *verbatim* to the source code, no need to encode it in any way, PHP does not care.