106
seCure develoPment For mobIle APPs
Header Setup
Make sure that each page that gets sent out includes the following header() func-
tion call. is tells the browser to explicitly display content as UTF-8. e browser
takes this header command as its primary directive for knowing how to treat content.
<?php header('Content-type: text/html; charset = UTF-8'); ?>
Meta-Tag Setup
Additionally, set the HTML meta-tag in the header section of each HTML page.
is also informs the browser what type of content it is displaying. Second, it helps
anyone looking at the source to know what the character set is.
For HTML5, the specification has a new, less verbose way to declare the document
encoding, which is now supported by most modern browsers. If your page ...