使用井号时出现奇怪字符 [英] Strange characters when using pound sign

查看:85
本文介绍了使用井号时出现奇怪字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的标题中有这一行..

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.

如果我提交我的表单,然后print_r $ _POST数组我得到:

If I submit my form and then print_r the $_POST array I get:

[field2_title] =>£问题

[field2_title] => £ Question

我认为问题可能是代码点击器$ this-> input-> post()函数,但它发生之前。

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?

我也试过了这个..

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">


推荐答案

在您的视图中,尝试添加以下代码: / p>

In your view, try adding the following code:

<?php header('Content-Type: text/html; Charset=UTF-8'); ?>

这篇关于使用井号时出现奇怪字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆