ChinaUnix.net
相关文章推荐:

php utf8ToUnicode

Handling utf-8 with php This page is intended as a reference for functionality php provides which can either help with handling utf-8 or should be regarded as a risk when used in conjunction with utf-8 encoded strings. Further information can be found on the Internationalization (I18N) and Character Sets / Character Encoding Issues pages. Note that this page applies to php utf-8 "Dangerous" ...

by lsstarboy - php文档中心 - 2009-12-23 08:20:37 阅读(2200) 回复(0)

相关讨论

问题: 保存为utf-8格式的php文件运行时header函数 Cannot modify header information Unicode规范中有一个BOM的概念。BOM——Byte Order Mark,就是字节序标记。在 浅谈Unicode 有关于BOM的说明: 在UCS 编码中有一个叫做"ZERO WIDTH NO-BREAK SPACE"的字符,它的编码是FEFF。而FFFE在UCS中是不存在的字符,所以不应该出现在实际传输中。UCS规范建议我们在传输字节流前,先传输字符"ZERO WIDTH NO-BREAK SPACE"。这样如果接收者收...

by linxh - php文档中心 - 2007-04-27 11:18:47 阅读(607) 回复(0)

本帖最后由 newstudent2011 于 2011-07-24 10:35 编辑 我的php 代码是gbk的 mysql也是utf8的,这个系统编码不能改 但,我的一个外部接口接受的数据来源是GB2312 (GET 方式) 我要怎么样转码才能插入数据

by newstudent2011 - PHP - 2011-07-31 12:56:30 阅读(3068) 回复(5)

大家好我在php编程中使用utf-8的编码,但是现在有一个问题: 比如我有一个GET的方式传值: test.php?testinfo=这里是utf-8的中文&testinfo1=这里还是utf-8的编码。 然后我在test.php文件中print_r($_GET)他不能分辨两个参数,请问有什么解决办法吗?谢谢! 这里有相关信息: http://www.phpchina.com/bbs/archiver/tid-20367.html 7、URL:为了让URL变得更为友好,许多php程序员喜欢让URL显示文字而不是URL编码,目前较为合理的解...

by hongfengyue - PHP - 2007-11-13 17:53:52 阅读(3301) 回复(1)

php文件的编码是utf-8最好吗?就是用Windows记事本打开,“文件”-“另存为”. 选择编码为utf-8. 是不是这样更好。光是在XHTML文件: utf-8"/> 里设置编码为utf-8, 好像不够吧。 :em43: :em43: :em43: :em43:

by akyahoo - PHP - 2009-08-27 15:12:51 阅读(1854) 回复(6)

php中GBK和utf8编码处理 作者:heiyeluren 来源: [color="#0000ff"]heiyeluren的blog 2008-01-21 最后更新:2008-01-21 15:14:07 收藏到网摘: 一、编码范围 1. GBK (GB2312/GB18030) \x00-\xff GBK双字节编码范围 \x20-\x7f ASCII \xa1-\xff 中文 \x80-\xff 中文 2. utf-8 (Unicode) \u4e00-\u9fa5 (中文) \x3130-\x318F (韩文 \xAC00-\xD7A3 (韩文) \u0800-\u4e00 (日文) ps: 韩文是大于[\u...

by hkebao - php文档中心 - 2009-07-23 11:48:32 阅读(977) 回复(0)

php自带的json_encode只支持utf-8编码,其他编码的需要转到utf-8编码下才能使用。下面是自己写的处理这个问题的函数,分享给大家,希望能对大家有用。注释很详细了,就不说多了,直接看吧。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 /* +------------------------ json_encode 增强版 可将任意编码的...

by kinganeng - php文档中心 - 2009-04-18 23:26:13 阅读(1148) 回复(0)

?php // Returns true if $string is valid utf-8 and false otherwise. function is_utf8($string) { // From http://w3.org/International/questions/qa-forms-utf-8.html return preg_match('%^(?: [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte | \xED[\x80-\x9F][\x...

by yanjing5462 - php文档中心 - 2009-04-16 14:51:45 阅读(2061) 回复(0)

php中GBK和utf8编码处理 一、编码范围 1. GBK (GB2312/GB18030) x00-xff GBK双字节编码范围 x20-x7f ASCII xa1-xff 中文 x80-xff 中文 2. utf-8 (Unicode) u4e00-u9fa5 (中文) x3130-x318F (韩文 xAC00-xD7A3 (韩文) u0800-u4e00 (日文) ps: 韩文是大于[u9fa5]的字符 正则例子: PLAIN TEXT php: preg_replace("/([x80-xff])/","",$str); preg_replace("/([u4e00-u9fa5])/","",$str); 二、代码例子 PLAIN TEXT php: //判断内...

by chencs - php文档中心 - 2008-12-02 15:38:09 阅读(1240) 回复(0)

php中GBK和utf8编码处理 一、编码范围 1. GBK (GB2312/GB18030) \x00-\xff GBK双字节编码范围 \x20-\x7f ASCII \xa1-\xff 中文 \x80-\xff 中文 2. utf-8 (Unicode) \u4e00-\u9fa5 (中文) \x3130-\x318F (韩文 \xAC00-\xD7A3 (韩文) \u0800-\u4e00 (日文) ps: 韩文是大于[\u9fa5]的字符 正则例子: preg_replace("/([\x80-\xff])/","",$str); preg_replace("/([u4e00-u9fa5])/","",$str); 二、代码例子 //判断内容里有没有中文...

by bj2008_0201 - php文档中心 - 2008-09-11 10:50:29 阅读(1385) 回复(0)

一、编码范围 1. GBK (GB2312/GB18030) \x00-\xff GBK双字节编码范围 \x20-\x7f ASCII \xa1-\xff 中文 \x80-\xff 中文 2. utf-8 (Unicode) \u4e00-\u9fa5 (中文) \x3130-\x318F (韩文 \xAC00-\xD7A3 (韩文) \u0800-\u4e00 (日文) ps: 韩文是大于[\u9fa5]的字符 正则例子: preg_replace("/([\x80-\xff])/","",$str); preg_replace("/([u4e00-u9fa5])/","",$str); 二、代码例子 //判断内容里有没有中文-GBK (php) function ch...

by 剑心通明 - php文档中心 - 2008-05-27 22:13:38 阅读(823) 回复(0)