OK, I have this
site where some umlauts aren’t displayed correctly. Specifically those that aren’t directly written in the default HTML template but included through include files (Cake PHP’s THTML files in this case). I can encode some of the text with HTML entities but only the ones that are directly written in the HTML, not the ones that are written through PHP.
Example:
PHP Code:
<?php echo $html->link(/*$comment['User']['username'].*/'Kommentar zum Geständnis machen', '/messages/add/'.$comment['Comment']['user_id'].'/'.$comment['Comment']['id']); ?>
<?php if($session->read('user.admin') == '1') { ?>
<a href="<?php echo $html->url('/admin/comments/delete/'. $comment['Comment']['id']); ?>">[Löschen</a>
The ö in the word “Löschen” in the anchor (last line in example) would be displayed as “ö” if I put it literally but I can encode it as
ö (however, I’d rather write it out literally). However, the ä in the word “Geständnis” is echoed through PHP and I can’t put an HTML entity there because it would output it literally (as
ä). I’ve come as far as figuring out that it must be the encoding of that THTML file (or the way PHP outputs characters) as plain HTML in the master template will be output correctly if I change the header’s
charset.
Unfortunately I’m not advanced enough in PHP to figure it out myself so how do I set/change the character encoding PHP is outputting? Or specifically how can I make it so I get proper characters from the PHP output rather than “ä” (that’s the output from the character “ä”) etc.?