Home > Backend Development > PHP Tutorial > 关于两页面编码不一样

关于两页面编码不一样

WBOY
Release: 2016-06-20 12:46:20
Original
982 people have browsed it

本人的网站是UF8编码,现在想做个短信接口,那边接口是gbk编码   (用GET方式网址传参到短信接口页面)

那么我 这边uf8页面如何写法 才能把中文信息正确传到短信的gbk页面呢


回复讨论(解决方案)

在发送json时

header('Content-Type:text/json;charset=gbk');
Copy after login
Copy after login
试试

在发送json时

header('Content-Type:text/json;charset=gbk');
Copy after login
Copy after login
试试



我的不是用JSON,是直接用GET传参过去的,就是UF8页面GET传到到GB2312页面 如何处理这编码问题呢

传递的数据中有中文吗?如有请先转成 gbk 的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template