会正确显示。 我的 MyS-6ren">
gpt4 book ai didi

mysql - codeigniter、标准 html 与表单助手中 utf8(希腊语)字符输出的差异

转载 作者:行者123 更新时间:2023-11-29 03:05:50 24 4
gpt4 key购买 nike

这个:

<td><?php echo form_input('post_title',set_value('post_title',$post->post_title)); ?></td>

将显示希腊字符(或除拉丁字符以外的任何其他字符),如页面上的 &#xxx。

这个:

<p>Title: <input name="post_title" type="text" value="<?php echo $post->post_title ?>"/></p>

会正确显示。

Web page

我的 MySQL 类型是 MyISAM 和 utf8_latin_ci 排序规则。

尝试从 phpMyAdmin 浏览也给我希腊语 &#xxx...

phpMyAdmin

错在哪里?

P.S 来自 codeigniter 手册关于表单辅助方法

and will always add the attribute accept-charset based on the charset value in your config file.

我的配置文件设置为

$config['charset'] = 'UTF-8';

更新:我的页眉:

GET /posts/editpost/23 HTTP/1.1
Host: my.xxx.com
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22
Referer: http://my.xxx.com/posts
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

最佳答案

这是字符集的普遍问题。请在 HTML 文件、CI 配置文件和数据库中最重要的地方保持字符集编码相同。创建数据库时,选择 UTF-8 或任何其他适合您的语言(对于大多数语言 UTF-8 有效)。或者您也可以为单个表更改它。请进行这些更改,您将获得正确的希腊语版本。谢谢

关于mysql - codeigniter、标准 html 与表单助手中 utf8(希腊语)字符输出的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15445819/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com