I have developed web applications for 1 year where the environment is(apache,php,html5 and javascript).I didn't care before this time to encoding issues.It was like the magic.I merely set mysql connection in a configuration file to UTF-8 and forget.  

But after my experience grew I faced cases where I need to fully understand how encoding issues are solved in this environment.When I get something,I miss the others.So I couldn't get the full picture.  

To be clear:  

* Javascript Strings are UTF-16
* HTTP transport encoding is arbitrary.
* PHP Strings are Binary.
* Mysql connection also is arbitrary.

How the conversion is done and what are the possible issues I need to care about.