问题
I've already got this line in my header..
<meta http-equiv="content-type" content="text/html; charset=utf-8">
I have an input form and when I enter a pound sign £ it's coming out with a strange character before it. The values are stored in the database and then displayed but the problem seems to be before we even get to the database.
If I submit my form and then print_r the $_POST array I get:
[field2_title] => £ Question
I thought the issue might be with the code igniter $this->input->post() function but it's happening before then. Other than adding the meta tag which I've already done I'm not sure what else to try?
I have also tried this..
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
回答1:
In your view, try adding the following code:
<?php header('Content-Type: text/html; Charset=UTF-8'); ?>
来源:https://stackoverflow.com/questions/15575643/strange-characters-when-using-pound-sign